From 03176ff07af33a9e064105611a53be94eac4cb67 Mon Sep 17 00:00:00 2001 From: Anna Khmelnitsky Date: Wed, 27 Sep 2023 21:30:00 +0000 Subject: [PATCH] Rename uplink host switch profile for consistency In order to avoid confusion, objects based on policy API should contain _policy prefix. We omitted the prefix for sake of shorter names in some fabric resources, however this causes confusion in dependency management, since policy resources relay on 'path' rather than 'id'. Signed-off-by: Anna Khmelnitsky --- ...nsxt_policy_uplink_host_switch_profile.go} | 2 +- nsxt/provider.go | 132 +++++++++--------- ...nsxt_policy_uplink_host_switch_profile.go} | 0 ...policy_uplink_host_switch_profile_test.go} | 16 +-- ..._uplink_host_switch_profile.html.markdown} | 8 +- ..._uplink_host_switch_profile.html.markdown} | 6 +- 6 files changed, 82 insertions(+), 82 deletions(-) rename nsxt/{data_source_nsxt_uplink_host_switch_profile.go => data_source_nsxt_policy_uplink_host_switch_profile.go} (89%) rename nsxt/{resource_nsxt_uplink_host_switch_profile.go => resource_nsxt_policy_uplink_host_switch_profile.go} (100%) rename nsxt/{resource_nsxt_uplink_host_switch_profile_test.go => resource_nsxt_policy_uplink_host_switch_profile_test.go} (96%) rename website/docs/d/{uplink_host_switch_profile.markdown => policy_uplink_host_switch_profile.html.markdown} (74%) rename website/docs/r/{uplink_host_switch_profile.html.markdown => policy_uplink_host_switch_profile.html.markdown} (96%) diff --git a/nsxt/data_source_nsxt_uplink_host_switch_profile.go b/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go similarity index 89% rename from nsxt/data_source_nsxt_uplink_host_switch_profile.go rename to nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go index 881c8a2a3..dd328adec 100644 --- a/nsxt/data_source_nsxt_uplink_host_switch_profile.go +++ b/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go @@ -31,5 +31,5 @@ func dataSourceNsxtUplinkHostSwitchProfileRead(d *schema.ResourceData, m interfa return nil } - return fmt.Errorf("UplinkHostSwitchProfile with name '%s' was not found", d.Get("display_name").(string)) + return fmt.Errorf("PolicyUplinkHostSwitchProfile with name '%s' was not found", d.Get("display_name").(string)) } diff --git a/nsxt/provider.go b/nsxt/provider.go index 0faaf9306..9e561116e 100644 --- a/nsxt/provider.go +++ b/nsxt/provider.go @@ -231,71 +231,71 @@ func Provider() *schema.Provider { }, DataSourcesMap: map[string]*schema.Resource{ - "nsxt_provider_info": dataSourceNsxtProviderInfo(), - "nsxt_transport_zone": dataSourceNsxtTransportZone(), - "nsxt_switching_profile": dataSourceNsxtSwitchingProfile(), - "nsxt_logical_tier0_router": dataSourceNsxtLogicalTier0Router(), - "nsxt_logical_tier1_router": dataSourceNsxtLogicalTier1Router(), - "nsxt_mac_pool": dataSourceNsxtMacPool(), - "nsxt_ns_group": dataSourceNsxtNsGroup(), - "nsxt_ns_groups": dataSourceNsxtNsGroups(), - "nsxt_ns_service": dataSourceNsxtNsService(), - "nsxt_ns_services": dataSourceNsxtNsServices(), - "nsxt_edge_cluster": dataSourceNsxtEdgeCluster(), - "nsxt_certificate": dataSourceNsxtCertificate(), - "nsxt_ip_pool": dataSourceNsxtIPPool(), - "nsxt_firewall_section": dataSourceNsxtFirewallSection(), - "nsxt_management_cluster": dataSourceNsxtManagementCluster(), - "nsxt_policy_edge_cluster": dataSourceNsxtPolicyEdgeCluster(), - "nsxt_policy_edge_node": dataSourceNsxtPolicyEdgeNode(), - "nsxt_policy_tier0_gateway": dataSourceNsxtPolicyTier0Gateway(), - "nsxt_policy_tier1_gateway": dataSourceNsxtPolicyTier1Gateway(), - "nsxt_policy_service": dataSourceNsxtPolicyService(), - "nsxt_policy_realization_info": dataSourceNsxtPolicyRealizationInfo(), - "nsxt_policy_segment_realization": dataSourceNsxtPolicySegmentRealization(), - "nsxt_policy_transport_zone": dataSourceNsxtPolicyTransportZone(), - "nsxt_policy_ip_discovery_profile": dataSourceNsxtPolicyIPDiscoveryProfile(), - "nsxt_policy_spoofguard_profile": dataSourceNsxtPolicySpoofGuardProfile(), - "nsxt_policy_qos_profile": dataSourceNsxtPolicyQosProfile(), - "nsxt_policy_ipv6_ndra_profile": dataSourceNsxtPolicyIpv6NdraProfile(), - "nsxt_policy_ipv6_dad_profile": dataSourceNsxtPolicyIpv6DadProfile(), - "nsxt_policy_gateway_qos_profile": dataSourceNsxtPolicyGatewayQosProfile(), - "nsxt_policy_segment_security_profile": dataSourceNsxtPolicySegmentSecurityProfile(), - "nsxt_policy_mac_discovery_profile": dataSourceNsxtPolicyMacDiscoveryProfile(), - "nsxt_policy_vm": dataSourceNsxtPolicyVM(), - "nsxt_policy_vms": dataSourceNsxtPolicyVMs(), - "nsxt_policy_lb_app_profile": dataSourceNsxtPolicyLBAppProfile(), - "nsxt_policy_lb_client_ssl_profile": dataSourceNsxtPolicyLBClientSslProfile(), - "nsxt_policy_lb_server_ssl_profile": dataSourceNsxtPolicyLBServerSslProfile(), - "nsxt_policy_lb_monitor": dataSourceNsxtPolicyLBMonitor(), - "nsxt_policy_certificate": dataSourceNsxtPolicyCertificate(), - "nsxt_policy_lb_persistence_profile": dataSourceNsxtPolicyLbPersistenceProfile(), - "nsxt_policy_vni_pool": dataSourceNsxtPolicyVniPool(), - "nsxt_policy_ip_block": dataSourceNsxtPolicyIPBlock(), - "nsxt_policy_ip_pool": dataSourceNsxtPolicyIPPool(), - "nsxt_policy_site": dataSourceNsxtPolicySite(), - "nsxt_policy_gateway_policy": dataSourceNsxtPolicyGatewayPolicy(), - "nsxt_policy_security_policy": dataSourceNsxtPolicySecurityPolicy(), - "nsxt_policy_group": dataSourceNsxtPolicyGroup(), - "nsxt_policy_context_profile": dataSourceNsxtPolicyContextProfile(), - "nsxt_policy_dhcp_server": dataSourceNsxtPolicyDhcpServer(), - "nsxt_policy_bfd_profile": dataSourceNsxtPolicyBfdProfile(), - "nsxt_policy_intrusion_service_profile": dataSourceNsxtPolicyIntrusionServiceProfile(), - "nsxt_policy_lb_service": dataSourceNsxtPolicyLbService(), - "nsxt_policy_gateway_locale_service": dataSourceNsxtPolicyGatewayLocaleService(), - "nsxt_policy_bridge_profile": dataSourceNsxtPolicyBridgeProfile(), - "nsxt_policy_ipsec_vpn_local_endpoint": dataSourceNsxtPolicyIPSecVpnLocalEndpoint(), - "nsxt_policy_ipsec_vpn_service": dataSourceNsxtPolicyIPSecVpnService(), - "nsxt_policy_l2_vpn_service": dataSourceNsxtPolicyL2VpnService(), - "nsxt_policy_segment": dataSourceNsxtPolicySegment(), - "nsxt_policy_project": dataSourceNsxtPolicyProject(), - "nsxt_policy_gateway_prefix_list": dataSourceNsxtPolicyGatewayPrefixList(), - "nsxt_policy_gateway_route_map": dataSourceNsxtPolicyGatewayRouteMap(), - "nsxt_uplink_host_switch_profile": dataSourceNsxtUplinkHostSwitchProfile(), - "nsxt_compute_manager": dataSourceNsxtComputeManager(), - "nsxt_transport_node_realization": dataSourceNsxtTransportNodeRealization(), - "nsxt_failure_domain": dataSourceNsxtFailureDomain(), - "nsxt_compute_collection": dataSourceNsxtComputeCollection(), + "nsxt_provider_info": dataSourceNsxtProviderInfo(), + "nsxt_transport_zone": dataSourceNsxtTransportZone(), + "nsxt_switching_profile": dataSourceNsxtSwitchingProfile(), + "nsxt_logical_tier0_router": dataSourceNsxtLogicalTier0Router(), + "nsxt_logical_tier1_router": dataSourceNsxtLogicalTier1Router(), + "nsxt_mac_pool": dataSourceNsxtMacPool(), + "nsxt_ns_group": dataSourceNsxtNsGroup(), + "nsxt_ns_groups": dataSourceNsxtNsGroups(), + "nsxt_ns_service": dataSourceNsxtNsService(), + "nsxt_ns_services": dataSourceNsxtNsServices(), + "nsxt_edge_cluster": dataSourceNsxtEdgeCluster(), + "nsxt_certificate": dataSourceNsxtCertificate(), + "nsxt_ip_pool": dataSourceNsxtIPPool(), + "nsxt_firewall_section": dataSourceNsxtFirewallSection(), + "nsxt_management_cluster": dataSourceNsxtManagementCluster(), + "nsxt_policy_edge_cluster": dataSourceNsxtPolicyEdgeCluster(), + "nsxt_policy_edge_node": dataSourceNsxtPolicyEdgeNode(), + "nsxt_policy_tier0_gateway": dataSourceNsxtPolicyTier0Gateway(), + "nsxt_policy_tier1_gateway": dataSourceNsxtPolicyTier1Gateway(), + "nsxt_policy_service": dataSourceNsxtPolicyService(), + "nsxt_policy_realization_info": dataSourceNsxtPolicyRealizationInfo(), + "nsxt_policy_segment_realization": dataSourceNsxtPolicySegmentRealization(), + "nsxt_policy_transport_zone": dataSourceNsxtPolicyTransportZone(), + "nsxt_policy_ip_discovery_profile": dataSourceNsxtPolicyIPDiscoveryProfile(), + "nsxt_policy_spoofguard_profile": dataSourceNsxtPolicySpoofGuardProfile(), + "nsxt_policy_qos_profile": dataSourceNsxtPolicyQosProfile(), + "nsxt_policy_ipv6_ndra_profile": dataSourceNsxtPolicyIpv6NdraProfile(), + "nsxt_policy_ipv6_dad_profile": dataSourceNsxtPolicyIpv6DadProfile(), + "nsxt_policy_gateway_qos_profile": dataSourceNsxtPolicyGatewayQosProfile(), + "nsxt_policy_segment_security_profile": dataSourceNsxtPolicySegmentSecurityProfile(), + "nsxt_policy_mac_discovery_profile": dataSourceNsxtPolicyMacDiscoveryProfile(), + "nsxt_policy_vm": dataSourceNsxtPolicyVM(), + "nsxt_policy_vms": dataSourceNsxtPolicyVMs(), + "nsxt_policy_lb_app_profile": dataSourceNsxtPolicyLBAppProfile(), + "nsxt_policy_lb_client_ssl_profile": dataSourceNsxtPolicyLBClientSslProfile(), + "nsxt_policy_lb_server_ssl_profile": dataSourceNsxtPolicyLBServerSslProfile(), + "nsxt_policy_lb_monitor": dataSourceNsxtPolicyLBMonitor(), + "nsxt_policy_certificate": dataSourceNsxtPolicyCertificate(), + "nsxt_policy_lb_persistence_profile": dataSourceNsxtPolicyLbPersistenceProfile(), + "nsxt_policy_vni_pool": dataSourceNsxtPolicyVniPool(), + "nsxt_policy_ip_block": dataSourceNsxtPolicyIPBlock(), + "nsxt_policy_ip_pool": dataSourceNsxtPolicyIPPool(), + "nsxt_policy_site": dataSourceNsxtPolicySite(), + "nsxt_policy_gateway_policy": dataSourceNsxtPolicyGatewayPolicy(), + "nsxt_policy_security_policy": dataSourceNsxtPolicySecurityPolicy(), + "nsxt_policy_group": dataSourceNsxtPolicyGroup(), + "nsxt_policy_context_profile": dataSourceNsxtPolicyContextProfile(), + "nsxt_policy_dhcp_server": dataSourceNsxtPolicyDhcpServer(), + "nsxt_policy_bfd_profile": dataSourceNsxtPolicyBfdProfile(), + "nsxt_policy_intrusion_service_profile": dataSourceNsxtPolicyIntrusionServiceProfile(), + "nsxt_policy_lb_service": dataSourceNsxtPolicyLbService(), + "nsxt_policy_gateway_locale_service": dataSourceNsxtPolicyGatewayLocaleService(), + "nsxt_policy_bridge_profile": dataSourceNsxtPolicyBridgeProfile(), + "nsxt_policy_ipsec_vpn_local_endpoint": dataSourceNsxtPolicyIPSecVpnLocalEndpoint(), + "nsxt_policy_ipsec_vpn_service": dataSourceNsxtPolicyIPSecVpnService(), + "nsxt_policy_l2_vpn_service": dataSourceNsxtPolicyL2VpnService(), + "nsxt_policy_segment": dataSourceNsxtPolicySegment(), + "nsxt_policy_project": dataSourceNsxtPolicyProject(), + "nsxt_policy_gateway_prefix_list": dataSourceNsxtPolicyGatewayPrefixList(), + "nsxt_policy_gateway_route_map": dataSourceNsxtPolicyGatewayRouteMap(), + "nsxt_policy_uplink_host_switch_profile": dataSourceNsxtUplinkHostSwitchProfile(), + "nsxt_compute_manager": dataSourceNsxtComputeManager(), + "nsxt_transport_node_realization": dataSourceNsxtTransportNodeRealization(), + "nsxt_failure_domain": dataSourceNsxtFailureDomain(), + "nsxt_compute_collection": dataSourceNsxtComputeCollection(), }, ResourcesMap: map[string]*schema.Resource{ @@ -425,7 +425,7 @@ func Provider() *schema.Provider { "nsxt_edge_cluster": resourceNsxtEdgeCluster(), "nsxt_compute_manager": resourceNsxtComputeManager(), "nsxt_manager_cluster": resourceNsxtManagerCluster(), - "nsxt_uplink_host_switch_profile": resourceNsxtUplinkHostSwitchProfile(), + "nsxt_policy_uplink_host_switch_profile": resourceNsxtUplinkHostSwitchProfile(), "nsxt_transport_node": resourceNsxtTransportNode(), "nsxt_failure_domain": resourceNsxtFailureDomain(), "nsxt_cluster_virtual_ip": resourceNsxtClusterVirualIP(), diff --git a/nsxt/resource_nsxt_uplink_host_switch_profile.go b/nsxt/resource_nsxt_policy_uplink_host_switch_profile.go similarity index 100% rename from nsxt/resource_nsxt_uplink_host_switch_profile.go rename to nsxt/resource_nsxt_policy_uplink_host_switch_profile.go diff --git a/nsxt/resource_nsxt_uplink_host_switch_profile_test.go b/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go similarity index 96% rename from nsxt/resource_nsxt_uplink_host_switch_profile_test.go rename to nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go index 0e7f5220f..ae5fffc62 100644 --- a/nsxt/resource_nsxt_uplink_host_switch_profile_test.go +++ b/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go @@ -59,8 +59,8 @@ var accTestUplinkHostSwitchProfileUpdateAttributes = map[string]string{ "named_teaming_policy": "FAILOVER_ORDER", } -func TestAccResourceNsxtUplinkHostSwitchProfile_basic(t *testing.T) { - testResourceName := "nsxt_uplink_host_switch_profile.test" +func TestAccResourceNsxtPolicyUplinkHostSwitchProfile_basic(t *testing.T) { + testResourceName := "nsxt_policy_uplink_host_switch_profile.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -180,8 +180,8 @@ func TestAccResourceNsxtUplinkHostSwitchProfile_basic(t *testing.T) { }) } -func TestAccResourceNsxtUplinkHostSwitchProfile_importBasic(t *testing.T) { - testResourceName := "nsxt_uplink_host_switch_profile.test" +func TestAccResourceNsxtPolicyUplinkHostSwitchProfile_importBasic(t *testing.T) { + testResourceName := "nsxt_policy_uplink_host_switch_profile.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -261,7 +261,7 @@ func testAccNsxtUplinkHostSwitchProfileTemplate(createFlow bool) string { attrMap = accTestUplinkHostSwitchProfileUpdateAttributes } return fmt.Sprintf(` -resource "nsxt_uplink_host_switch_profile" "test" { +resource "nsxt_policy_uplink_host_switch_profile" "test" { display_name = "%s" description = "%s" @@ -305,15 +305,15 @@ resource "nsxt_uplink_host_switch_profile" "test" { } } -data "nsxt_uplink_host_switch_profile" "test" { +data "nsxt_policy_uplink_host_switch_profile" "test" { display_name = "%s" - depends_on = [nsxt_uplink_host_switch_profile.test] + depends_on = [nsxt_policy_uplink_host_switch_profile.test] }`, attrMap["display_name"], attrMap["description"], attrMap["mtu"], attrMap["transport_vlan"], attrMap["overlay_encap"], attrMap["lag_name"], attrMap["lag_load_balance_algorithm"], attrMap["lag_mode"], attrMap["lag_number_of_uplinks"], attrMap["lag_timeout_type"], attrMap["teaming_al_uplink_name"], attrMap["teaming_al_uplink_type"], attrMap["teaming_sl_uplink_name"], attrMap["teaming_sl_uplink_type"], attrMap["teaming_policy"], attrMap["named_teaming_al_uplink_name"], attrMap["named_teaming_al_uplink_type"], attrMap["named_teaming_sl_uplink_name"], attrMap["named_teaming_sl_uplink_type"], attrMap["named_teaming_policy"], attrMap["named_teaming_name"], attrMap["display_name"]) } func testAccNsxtUplinkHostSwitchProfileMinimalistic() string { return fmt.Sprintf(` -resource "nsxt_uplink_host_switch_profile" "test" { +resource "nsxt_policy_uplink_host_switch_profile" "test" { display_name = "%s" teaming { active { diff --git a/website/docs/d/uplink_host_switch_profile.markdown b/website/docs/d/policy_uplink_host_switch_profile.html.markdown similarity index 74% rename from website/docs/d/uplink_host_switch_profile.markdown rename to website/docs/d/policy_uplink_host_switch_profile.html.markdown index 1874c1662..7d3cfa59d 100644 --- a/website/docs/d/uplink_host_switch_profile.markdown +++ b/website/docs/d/policy_uplink_host_switch_profile.html.markdown @@ -1,11 +1,11 @@ --- subcategory: "Beta" layout: "nsxt" -page_title: "NSXT: nsxt_uplink_host_switch_profile" -description: A host switch profile data source. +page_title: "NSXT: nsxt_policy_uplink_host_switch_profile" +description: An uplink host switch profile data source. --- -# nsxt_uplink_host_switch_profile +# nsxt_policy_uplink_host_switch_profile This data source provides information about uplink host switch profile configured on NSX. This data source is applicable to NSX Policy Manager. @@ -13,7 +13,7 @@ This data source is applicable to NSX Policy Manager. ## Example Usage ```hcl -data "nsxt_uplink_host_switch_profile" "uplink_host_switch_profile" { +data "nsxt_policy_uplink_host_switch_profile" "uplink_host_switch_profile" { display_name = "uplink_host_switch_profile1" } ``` diff --git a/website/docs/r/uplink_host_switch_profile.html.markdown b/website/docs/r/policy_uplink_host_switch_profile.html.markdown similarity index 96% rename from website/docs/r/uplink_host_switch_profile.html.markdown rename to website/docs/r/policy_uplink_host_switch_profile.html.markdown index 4d56314c9..1cfebbd45 100644 --- a/website/docs/r/uplink_host_switch_profile.html.markdown +++ b/website/docs/r/policy_uplink_host_switch_profile.html.markdown @@ -1,11 +1,11 @@ --- subcategory: "Beta" layout: "nsxt" -page_title: "NSXT: nsxt_uplink_host_switch_profile" +page_title: "NSXT: nsxt_policy_uplink_host_switch_profile" description: A resource to configure a uplink host switch profile in NSX Policy. --- -# nsxt_uplink_host_switch_profile +# nsxt_policy_uplink_host_switch_profile This resource provides a method for the management of a uplink host switch profile which can be used within NSX Policy. @@ -14,7 +14,7 @@ This resource is applicable to NSX Policy Manager. ## Example Usage ```hcl -resource "nsxt_uplink_host_switch_profile" "uplink_host_switch_profile" { +resource "nsxt_policy_uplink_host_switch_profile" "uplink_host_switch_profile" { description = "Uplink host switch profile provisioned by Terraform" display_name = "uplink_host_switch_profile"