Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent naming in TN data source #1198

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model"
)

func dataSourceNsxtEdgeTransportNode() *schema.Resource {
func dataSourceNsxtTransportNode() *schema.Resource {
return &schema.Resource{
Read: dataSourceNsxtEdgeTransportNodeRead,
Read: dataSourceNsxtTransportNodeRead,

Schema: map[string]*schema.Schema{
"id": getDataSourceIDSchema(),
Expand All @@ -25,7 +25,7 @@ func dataSourceNsxtEdgeTransportNode() *schema.Resource {
}
}

func dataSourceNsxtEdgeTransportNodeRead(d *schema.ResourceData, m interface{}) error {
func dataSourceNsxtTransportNodeRead(d *schema.ResourceData, m interface{}) error {
connector := getPolicyConnector(m)
client := nsx.NewTransportNodesClient(connector)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccDataSourceNsxtEdgeTransportNode_basic(t *testing.T) {
func TestAccDataSourceNsxtTransportNode_basic(t *testing.T) {
htnName := getEdgeTransportNodeName()
testResourceName := "data.nsxt_edge_transport_node.test"
testResourceName := "data.nsxt_transport_node.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
Expand All @@ -23,7 +23,7 @@ func TestAccDataSourceNsxtEdgeTransportNode_basic(t *testing.T) {
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccNSXEdgeTransportNodeReadTemplate(htnName),
Config: testAccNSXTransportNodeReadTemplate(htnName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testResourceName, "display_name", htnName),
resource.TestCheckResourceAttrSet(testResourceName, "id"),
Expand All @@ -33,9 +33,9 @@ func TestAccDataSourceNsxtEdgeTransportNode_basic(t *testing.T) {
})
}

func testAccNSXEdgeTransportNodeReadTemplate(name string) string {
func testAccNSXTransportNodeReadTemplate(name string) string {
return fmt.Sprintf(`
data "nsxt_edge_transport_node" "test" {
data "nsxt_transport_node" "test" {
display_name = "%s"
}`, name)
}
2 changes: 1 addition & 1 deletion nsxt/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func Provider() *schema.Provider {
"nsxt_policy_host_transport_node": dataSourceNsxtPolicyHostTransportNode(),
"nsxt_manager_cluster_node": dataSourceNsxtManagerClusterNode(),
"nsxt_policy_host_transport_node_profile": dataSourceNsxtPolicyHostTransportNodeProfile(),
"nsxt_transport_node": dataSourceNsxtEdgeTransportNode(),
"nsxt_transport_node": dataSourceNsxtTransportNode(),
"nsxt_discovered_node": dataSourceNsxtDiscoveredNode(),
"nsxt_edge_upgrade_group": dataSourceNsxtEdgeUpgradeGroup(),
"nsxt_host_upgrade_group": dataSourceNsxtHostUpgradeGroup(),
Expand Down
29 changes: 0 additions & 29 deletions website/docs/d/edge_transport_node.html.markdown

This file was deleted.

29 changes: 29 additions & 0 deletions website/docs/d/transport_node.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
subcategory: "Beta"
layout: "nsxt"
page_title: "NSXT: transport_node"
description: An Transport Node data source.
---

# nsxt_edge_transport_node

This data source provides information about Transport Node configured on NSX.

## Example Usage

```hcl
data "nsxt_transport_node" "test_node" {
display_name = "edgenode1"
}
```

## Argument Reference

* `id` - (Optional) The ID of Transport Node to retrieve
* `display_name` - (Optional) The Display Name of the Transport Node to retrieve.

## Attributes Reference

In addition to arguments listed above, the following attributes are exported:

* `description` - The description of the resource.
Loading