diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index adafd37a7..a7e880068 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -23,7 +23,7 @@ jobs: uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version-file: 'go.mod' - cache: true + cache: false - run: go mod download - run: go build -v . - name: Run Linters @@ -32,5 +32,3 @@ jobs: version: v1.62.0 args: --issues-exit-code=1 --timeout 10m only-new-issues: true - skip-pkg-cache: true - skip-build-cache: true diff --git a/main.go b/main.go index 406efe106..e41c44529 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package main diff --git a/nsxt/data_source_nsxt_certificate.go b/nsxt/data_source_nsxt_certificate.go index 8d34a7a57..5658eaecd 100644 --- a/nsxt/data_source_nsxt_certificate.go +++ b/nsxt/data_source_nsxt_certificate.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_compute_collection.go b/nsxt/data_source_nsxt_compute_collection.go index 9089b3958..b8aeae9c4 100644 --- a/nsxt/data_source_nsxt_compute_collection.go +++ b/nsxt/data_source_nsxt_compute_collection.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_compute_collection_test.go b/nsxt/data_source_nsxt_compute_collection_test.go index 8e4b77a9c..42d151a9c 100644 --- a/nsxt/data_source_nsxt_compute_collection_test.go +++ b/nsxt/data_source_nsxt_compute_collection_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_compute_manager.go b/nsxt/data_source_nsxt_compute_manager.go index bc9ba4278..0673d5b4e 100644 --- a/nsxt/data_source_nsxt_compute_manager.go +++ b/nsxt/data_source_nsxt_compute_manager.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_compute_manager_realization.go b/nsxt/data_source_nsxt_compute_manager_realization.go index 2ffeef09f..9a3d40fc5 100644 --- a/nsxt/data_source_nsxt_compute_manager_realization.go +++ b/nsxt/data_source_nsxt_compute_manager_realization.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_compute_manager_test.go b/nsxt/data_source_nsxt_compute_manager_test.go index 6add184cd..9cc7317d7 100644 --- a/nsxt/data_source_nsxt_compute_manager_test.go +++ b/nsxt/data_source_nsxt_compute_manager_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_discovered_node.go b/nsxt/data_source_nsxt_discovered_node.go index 88a16d189..13ec99ef4 100644 --- a/nsxt/data_source_nsxt_discovered_node.go +++ b/nsxt/data_source_nsxt_discovered_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_edge_cluster.go b/nsxt/data_source_nsxt_edge_cluster.go index 796e32399..908500fb6 100644 --- a/nsxt/data_source_nsxt_edge_cluster.go +++ b/nsxt/data_source_nsxt_edge_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_edge_cluster_test.go b/nsxt/data_source_nsxt_edge_cluster_test.go index f61a9778f..79479b3da 100644 --- a/nsxt/data_source_nsxt_edge_cluster_test.go +++ b/nsxt/data_source_nsxt_edge_cluster_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_edge_upgrade_group.go b/nsxt/data_source_nsxt_edge_upgrade_group.go index 16027463d..8e8a52d54 100644 --- a/nsxt/data_source_nsxt_edge_upgrade_group.go +++ b/nsxt/data_source_nsxt_edge_upgrade_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_failure_domain.go b/nsxt/data_source_nsxt_failure_domain.go index 2719ba94e..e52e338d4 100644 --- a/nsxt/data_source_nsxt_failure_domain.go +++ b/nsxt/data_source_nsxt_failure_domain.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_firewall_section.go b/nsxt/data_source_nsxt_firewall_section.go index b94e3b3ee..ed18d2386 100644 --- a/nsxt/data_source_nsxt_firewall_section.go +++ b/nsxt/data_source_nsxt_firewall_section.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_firewall_section_test.go b/nsxt/data_source_nsxt_firewall_section_test.go index 335bd7d19..605b30b13 100644 --- a/nsxt/data_source_nsxt_firewall_section_test.go +++ b/nsxt/data_source_nsxt_firewall_section_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_host_upgrade_group.go b/nsxt/data_source_nsxt_host_upgrade_group.go index 92c997024..dc6e45d8c 100644 --- a/nsxt/data_source_nsxt_host_upgrade_group.go +++ b/nsxt/data_source_nsxt_host_upgrade_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ip_pool.go b/nsxt/data_source_nsxt_ip_pool.go index b5c02b768..ecad7dd10 100644 --- a/nsxt/data_source_nsxt_ip_pool.go +++ b/nsxt/data_source_nsxt_ip_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ip_pool_test.go b/nsxt/data_source_nsxt_ip_pool_test.go index 963ed5174..f366a50f5 100644 --- a/nsxt/data_source_nsxt_ip_pool_test.go +++ b/nsxt/data_source_nsxt_ip_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_logical_tier0_router.go b/nsxt/data_source_nsxt_logical_tier0_router.go index f1ef1f3a7..1e206c517 100644 --- a/nsxt/data_source_nsxt_logical_tier0_router.go +++ b/nsxt/data_source_nsxt_logical_tier0_router.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_logical_tier0_router_test.go b/nsxt/data_source_nsxt_logical_tier0_router_test.go index 31b34a821..06bc76c00 100644 --- a/nsxt/data_source_nsxt_logical_tier0_router_test.go +++ b/nsxt/data_source_nsxt_logical_tier0_router_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_logical_tier1_router.go b/nsxt/data_source_nsxt_logical_tier1_router.go index 66b3e6d6e..ebdd31064 100644 --- a/nsxt/data_source_nsxt_logical_tier1_router.go +++ b/nsxt/data_source_nsxt_logical_tier1_router.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_logical_tier1_router_test.go b/nsxt/data_source_nsxt_logical_tier1_router_test.go index fde3414a0..376f6a47c 100644 --- a/nsxt/data_source_nsxt_logical_tier1_router_test.go +++ b/nsxt/data_source_nsxt_logical_tier1_router_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_mac_pool.go b/nsxt/data_source_nsxt_mac_pool.go index a4e022cc3..f0f9ba879 100644 --- a/nsxt/data_source_nsxt_mac_pool.go +++ b/nsxt/data_source_nsxt_mac_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_mac_pool_test.go b/nsxt/data_source_nsxt_mac_pool_test.go index 863ef00a1..ae76504c1 100644 --- a/nsxt/data_source_nsxt_mac_pool_test.go +++ b/nsxt/data_source_nsxt_mac_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_management_cluster.go b/nsxt/data_source_nsxt_management_cluster.go index 087836a23..c2d9ebbe2 100644 --- a/nsxt/data_source_nsxt_management_cluster.go +++ b/nsxt/data_source_nsxt_management_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_management_cluster_test.go b/nsxt/data_source_nsxt_management_cluster_test.go index 7fcf940a6..0a4a57d24 100644 --- a/nsxt/data_source_nsxt_management_cluster_test.go +++ b/nsxt/data_source_nsxt_management_cluster_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_manager_cluster_node.go b/nsxt/data_source_nsxt_manager_cluster_node.go index 0e922046e..6deead1c9 100644 --- a/nsxt/data_source_nsxt_manager_cluster_node.go +++ b/nsxt/data_source_nsxt_manager_cluster_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_manager_cluster_node_test.go b/nsxt/data_source_nsxt_manager_cluster_node_test.go index 961623bd0..523f6012f 100644 --- a/nsxt/data_source_nsxt_manager_cluster_node_test.go +++ b/nsxt/data_source_nsxt_manager_cluster_node_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_manager_info.go b/nsxt/data_source_nsxt_manager_info.go index 6a65fa6ad..65e730720 100644 --- a/nsxt/data_source_nsxt_manager_info.go +++ b/nsxt/data_source_nsxt_manager_info.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_manager_info_test.go b/nsxt/data_source_nsxt_manager_info_test.go index b2f9663a9..2e599fae8 100644 --- a/nsxt/data_source_nsxt_manager_info_test.go +++ b/nsxt/data_source_nsxt_manager_info_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_group.go b/nsxt/data_source_nsxt_ns_group.go index 7cf3844d5..01be3d0a0 100644 --- a/nsxt/data_source_nsxt_ns_group.go +++ b/nsxt/data_source_nsxt_ns_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_group_test.go b/nsxt/data_source_nsxt_ns_group_test.go index 7bab47d66..f11aca2f6 100644 --- a/nsxt/data_source_nsxt_ns_group_test.go +++ b/nsxt/data_source_nsxt_ns_group_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_groups.go b/nsxt/data_source_nsxt_ns_groups.go index aa0afed1d..77861ddec 100644 --- a/nsxt/data_source_nsxt_ns_groups.go +++ b/nsxt/data_source_nsxt_ns_groups.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_groups_test.go b/nsxt/data_source_nsxt_ns_groups_test.go index b6d32dc1c..3c71fd59b 100644 --- a/nsxt/data_source_nsxt_ns_groups_test.go +++ b/nsxt/data_source_nsxt_ns_groups_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_service.go b/nsxt/data_source_nsxt_ns_service.go index 1ca6a0fa9..06592294a 100644 --- a/nsxt/data_source_nsxt_ns_service.go +++ b/nsxt/data_source_nsxt_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_service_test.go b/nsxt/data_source_nsxt_ns_service_test.go index e095b6404..f20463b1f 100644 --- a/nsxt/data_source_nsxt_ns_service_test.go +++ b/nsxt/data_source_nsxt_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_services.go b/nsxt/data_source_nsxt_ns_services.go index 28938e8de..6a324990d 100644 --- a/nsxt/data_source_nsxt_ns_services.go +++ b/nsxt/data_source_nsxt_ns_services.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_ns_services_test.go b/nsxt/data_source_nsxt_ns_services_test.go index 57aa6880f..5c5f8ffd6 100644 --- a/nsxt/data_source_nsxt_ns_services_test.go +++ b/nsxt/data_source_nsxt_ns_services_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_bfd_profile.go b/nsxt/data_source_nsxt_policy_bfd_profile.go index 64e68a238..859d19f8d 100644 --- a/nsxt/data_source_nsxt_policy_bfd_profile.go +++ b/nsxt/data_source_nsxt_policy_bfd_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_bfd_profile_test.go b/nsxt/data_source_nsxt_policy_bfd_profile_test.go index 7545f1996..9b72635ee 100644 --- a/nsxt/data_source_nsxt_policy_bfd_profile_test.go +++ b/nsxt/data_source_nsxt_policy_bfd_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_bridge_profile.go b/nsxt/data_source_nsxt_policy_bridge_profile.go index b0fc49b71..b3201dff4 100644 --- a/nsxt/data_source_nsxt_policy_bridge_profile.go +++ b/nsxt/data_source_nsxt_policy_bridge_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_bridge_profile_test.go b/nsxt/data_source_nsxt_policy_bridge_profile_test.go index 8e13c5703..fff0b6541 100644 --- a/nsxt/data_source_nsxt_policy_bridge_profile_test.go +++ b/nsxt/data_source_nsxt_policy_bridge_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -8,9 +9,13 @@ import ( "testing" "github.com/google/uuid" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx" ep "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/sites/enforcement_points" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/infra/sites/enforcement_points/edge_clusters" "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" ) @@ -42,6 +47,39 @@ func TestAccDataSourceNsxtPolicyBridgeProfile_basic(t *testing.T) { }) } +func getEdgeClusterPath() (string, error) { + connector, err := testAccGetPolicyConnector() + if err != nil { + return "", fmt.Errorf("error during test client initialization: %v", err) + } + client := nsx.NewEdgeClustersClient(connector) + clusterList, err := client.List(nil, nil, nil, nil, nil) + if err != nil { + return "", fmt.Errorf("error during edge cluster list retrieval: %v", err) + } + clusterName := getEdgeClusterName() + clusterID := "" + if clusterList.Results != nil { + for _, objList := range clusterList.Results { + if *objList.DisplayName == clusterName { + clusterID = *objList.Id + break + } + } + } + if clusterID != "" { + enClient := edge_clusters.NewEdgeNodesClient(connector) + objList, err := enClient.List(defaultSite, defaultEnforcementPoint, clusterID, nil, nil, nil, nil, nil, nil) + if err != nil { + return "", fmt.Errorf("error during edge node list retrieval: %v", err) + } + if len(objList.Results) > 0 { + return *objList.Results[0].Path, nil + } + } + return "", errors.NotFound{} +} + func testAccDataSourceNsxtPolicyBridgeProfileCreate(name string) error { connector, err := testAccGetPolicyConnector() if err != nil { @@ -59,6 +97,13 @@ func testAccDataSourceNsxtPolicyBridgeProfileCreate(name string) error { uuid, _ := uuid.NewRandom() id := uuid.String() + // Get Edge path + edgePath, err := getEdgeClusterPath() + if err == nil { + obj.EdgePaths = []string{edgePath} + } else if !isNotFoundError(err) { + return err + } client := ep.NewEdgeBridgeProfilesClient(connector) err = client.Patch(defaultSite, defaultEnforcementPoint, id, obj) diff --git a/nsxt/data_source_nsxt_policy_certificate.go b/nsxt/data_source_nsxt_policy_certificate.go index 0c90279c2..d9c2f797a 100644 --- a/nsxt/data_source_nsxt_policy_certificate.go +++ b/nsxt/data_source_nsxt_policy_certificate.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_certificate_test.go b/nsxt/data_source_nsxt_policy_certificate_test.go index d66ae5213..abde425c7 100644 --- a/nsxt/data_source_nsxt_policy_certificate_test.go +++ b/nsxt/data_source_nsxt_policy_certificate_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_context_profile.go b/nsxt/data_source_nsxt_policy_context_profile.go index 61589d6d4..91000e686 100644 --- a/nsxt/data_source_nsxt_policy_context_profile.go +++ b/nsxt/data_source_nsxt_policy_context_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_context_profile_test.go b/nsxt/data_source_nsxt_policy_context_profile_test.go index b67bbb816..22f47213c 100644 --- a/nsxt/data_source_nsxt_policy_context_profile_test.go +++ b/nsxt/data_source_nsxt_policy_context_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_dhcp_server.go b/nsxt/data_source_nsxt_policy_dhcp_server.go index a2a9d8964..5b66b0262 100644 --- a/nsxt/data_source_nsxt_policy_dhcp_server.go +++ b/nsxt/data_source_nsxt_policy_dhcp_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_dhcp_server_test.go b/nsxt/data_source_nsxt_policy_dhcp_server_test.go index 6a6a4dc57..4ade6c023 100644 --- a/nsxt/data_source_nsxt_policy_dhcp_server_test.go +++ b/nsxt/data_source_nsxt_policy_dhcp_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_distributed_flood_protection_profile.go b/nsxt/data_source_nsxt_policy_distributed_flood_protection_profile.go index e3226c34d..0efcd6fdc 100644 --- a/nsxt/data_source_nsxt_policy_distributed_flood_protection_profile.go +++ b/nsxt/data_source_nsxt_policy_distributed_flood_protection_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_distributed_vlan_connection.go b/nsxt/data_source_nsxt_policy_distributed_vlan_connection.go index 6bc59de67..1782e1a98 100644 --- a/nsxt/data_source_nsxt_policy_distributed_vlan_connection.go +++ b/nsxt/data_source_nsxt_policy_distributed_vlan_connection.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_edge_cluster.go b/nsxt/data_source_nsxt_policy_edge_cluster.go index d72aff707..d04b7ccaa 100644 --- a/nsxt/data_source_nsxt_policy_edge_cluster.go +++ b/nsxt/data_source_nsxt_policy_edge_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_edge_cluster_test.go b/nsxt/data_source_nsxt_policy_edge_cluster_test.go index 4f342fe9d..767977efe 100644 --- a/nsxt/data_source_nsxt_policy_edge_cluster_test.go +++ b/nsxt/data_source_nsxt_policy_edge_cluster_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_edge_node.go b/nsxt/data_source_nsxt_policy_edge_node.go index 770762467..053633dbe 100644 --- a/nsxt/data_source_nsxt_policy_edge_node.go +++ b/nsxt/data_source_nsxt_policy_edge_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_edge_node_test.go b/nsxt/data_source_nsxt_policy_edge_node_test.go index 7c4adc780..84fe4aa2b 100644 --- a/nsxt/data_source_nsxt_policy_edge_node_test.go +++ b/nsxt/data_source_nsxt_policy_edge_node_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_connection.go b/nsxt/data_source_nsxt_policy_gateway_connection.go index cfcf6c3e1..f4e717c09 100644 --- a/nsxt/data_source_nsxt_policy_gateway_connection.go +++ b/nsxt/data_source_nsxt_policy_gateway_connection.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_dns_forwarder.go b/nsxt/data_source_nsxt_policy_gateway_dns_forwarder.go index 3b3d2c96b..254ed6a52 100644 --- a/nsxt/data_source_nsxt_policy_gateway_dns_forwarder.go +++ b/nsxt/data_source_nsxt_policy_gateway_dns_forwarder.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_flood_protection_profile.go b/nsxt/data_source_nsxt_policy_gateway_flood_protection_profile.go index 31c99a76c..3a716b7f3 100644 --- a/nsxt/data_source_nsxt_policy_gateway_flood_protection_profile.go +++ b/nsxt/data_source_nsxt_policy_gateway_flood_protection_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_interface_realization.go b/nsxt/data_source_nsxt_policy_gateway_interface_realization.go index c56a9a1eb..f05b60600 100644 --- a/nsxt/data_source_nsxt_policy_gateway_interface_realization.go +++ b/nsxt/data_source_nsxt_policy_gateway_interface_realization.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_locale_service.go b/nsxt/data_source_nsxt_policy_gateway_locale_service.go index bb14d4e29..5af281d5b 100644 --- a/nsxt/data_source_nsxt_policy_gateway_locale_service.go +++ b/nsxt/data_source_nsxt_policy_gateway_locale_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_locale_service_test.go b/nsxt/data_source_nsxt_policy_gateway_locale_service_test.go index e2c2ac8ff..d2c40a37e 100644 --- a/nsxt/data_source_nsxt_policy_gateway_locale_service_test.go +++ b/nsxt/data_source_nsxt_policy_gateway_locale_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -139,14 +140,14 @@ data "nsxt_policy_edge_cluster" "test" { resource "nsxt_policy_tier0_gateway" "test" { display_name = "%s" - + locale_service { edge_cluster_path = data.nsxt_policy_edge_cluster.test.path } } data "nsxt_policy_gateway_locale_service" "test" { - gateway_path = nsxt_policy_tier0_gateway.test.path + gateway_path = nsxt_policy_tier0_gateway.test.path display_name = one(nsxt_policy_tier0_gateway.test.locale_service).display_name }`, getTestSiteName(), name) } diff --git a/nsxt/data_source_nsxt_policy_gateway_policy.go b/nsxt/data_source_nsxt_policy_gateway_policy.go index 62d68da5a..d096f9677 100644 --- a/nsxt/data_source_nsxt_policy_gateway_policy.go +++ b/nsxt/data_source_nsxt_policy_gateway_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_policy_test.go b/nsxt/data_source_nsxt_policy_gateway_policy_test.go index 0bd4ff7c8..ef7e7a98b 100644 --- a/nsxt/data_source_nsxt_policy_gateway_policy_test.go +++ b/nsxt/data_source_nsxt_policy_gateway_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_prefix_list.go b/nsxt/data_source_nsxt_policy_gateway_prefix_list.go index 9d49df9bc..3b8c2103d 100644 --- a/nsxt/data_source_nsxt_policy_gateway_prefix_list.go +++ b/nsxt/data_source_nsxt_policy_gateway_prefix_list.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_qos_profile.go b/nsxt/data_source_nsxt_policy_gateway_qos_profile.go index d3846cebe..b4e9812e1 100644 --- a/nsxt/data_source_nsxt_policy_gateway_qos_profile.go +++ b/nsxt/data_source_nsxt_policy_gateway_qos_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go b/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go index ca6a22327..b222df060 100644 --- a/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go +++ b/nsxt/data_source_nsxt_policy_gateway_qos_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_gateway_route_map.go b/nsxt/data_source_nsxt_policy_gateway_route_map.go index 5ed8a5885..2e38cb566 100644 --- a/nsxt/data_source_nsxt_policy_gateway_route_map.go +++ b/nsxt/data_source_nsxt_policy_gateway_route_map.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_group.go b/nsxt/data_source_nsxt_policy_group.go index 1a66ed36c..68024a048 100644 --- a/nsxt/data_source_nsxt_policy_group.go +++ b/nsxt/data_source_nsxt_policy_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_group_test.go b/nsxt/data_source_nsxt_policy_group_test.go index 9d5682fb6..2a79607d5 100644 --- a/nsxt/data_source_nsxt_policy_group_test.go +++ b/nsxt/data_source_nsxt_policy_group_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_groups.go b/nsxt/data_source_nsxt_policy_groups.go new file mode 100644 index 000000000..cc09e8bf4 --- /dev/null +++ b/nsxt/data_source_nsxt_policy_groups.go @@ -0,0 +1,50 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + +package nsxt + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/vmware/terraform-provider-nsxt/api/infra/domains" +) + +func dataSourceNsxtPolicyGroups() *schema.Resource { + return &schema.Resource{ + Read: dataSourceNsxtPolicyGroupsRead, + + Schema: map[string]*schema.Schema{ + "context": getContextSchema(false, false, false), + "domain": getDomainNameSchema(), + "items": { + Type: schema.TypeMap, + Description: "Mapping of service policy path by display name", + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceNsxtPolicyGroupsRead(d *schema.ResourceData, m interface{}) error { + connector := getPolicyConnector(m) + domainName := d.Get("domain").(string) + + client := domains.NewGroupsClient(getSessionContext(d, m), connector) + + groupsMap := make(map[string]string) + results, err := client.List(domainName, nil, nil, nil, nil, nil, nil, nil) + if err != nil { + return err + } + for _, r := range results.Results { + groupsMap[*r.DisplayName] = *r.Path + } + + d.Set("items", groupsMap) + d.SetId(newUUID()) + return nil +} diff --git a/nsxt/data_source_nsxt_policy_groups_test.go b/nsxt/data_source_nsxt_policy_groups_test.go new file mode 100644 index 000000000..d646b53ff --- /dev/null +++ b/nsxt/data_source_nsxt_policy_groups_test.go @@ -0,0 +1,78 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + +package nsxt + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccDataSourceNsxtPolicyGroups_basic(t *testing.T) { + testAccDataSourceNsxtPolicyGroupsBasic(t, false, func() { + testAccPreCheck(t) + }) +} + +func TestAccDataSourceNsxtPolicyGroups_multitenancy(t *testing.T) { + testAccDataSourceNsxtPolicyGroupsBasic(t, true, func() { + testAccPreCheck(t) + testAccOnlyMultitenancy(t) + }) +} + +func testAccDataSourceNsxtPolicyGroupsBasic(t *testing.T, withContext bool, preCheck func()) { + domain := "default" + groupName := getAccTestDataSourceName() + testResourceName := "data.nsxt_policy_groups.test" + checkResourceName := "data.nsxt_policy_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: preCheck, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccDataSourceNsxtPolicyGroupDeleteByName(domain, groupName) + }, + Steps: []resource.TestStep{ + { + PreConfig: func() { + if err := testAccDataSourceNsxtPolicyGroupCreate(domain, groupName); err != nil { + t.Error(err) + } + }, + Config: testAccNSXPolicyGroupsReadTemplate(groupName, withContext), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(testResourceName, "id"), + resource.TestCheckResourceAttr(checkResourceName, "display_name", groupName), + ), + }, + }, + }) +} + +func testAccNSXPolicyGroupsReadTemplate(groupName string, withContext bool) string { + context := "" + if withContext { + context = testAccNsxtPolicyMultitenancyContext() + } + return fmt.Sprintf(` +data "nsxt_policy_groups" "test" { +%s +} + +locals { +// Get id from path + path_split = split("/", data.nsxt_policy_groups.test.items["%s"]) + group_id = element(local.path_split, length(local.path_split) - 1) +} + +data "nsxt_policy_group" "test" { +%s + id = local.group_id +} +`, context, groupName, context) +} diff --git a/nsxt/data_source_nsxt_policy_host_transport_node.go b/nsxt/data_source_nsxt_policy_host_transport_node.go index 6aad09a2b..3cc63d49b 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_host_transport_node_collection.go b/nsxt/data_source_nsxt_policy_host_transport_node_collection.go index 6fef3eb81..e50c65575 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node_collection.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node_collection.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_host_transport_node_collection_realization.go b/nsxt/data_source_nsxt_policy_host_transport_node_collection_realization.go index 07f4c9715..a38f0b964 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node_collection_realization.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node_collection_realization.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_host_transport_node_profile.go b/nsxt/data_source_nsxt_policy_host_transport_node_profile.go index 71ad15580..1bebf9d4a 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node_profile.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_host_transport_node_profile_test.go b/nsxt/data_source_nsxt_policy_host_transport_node_profile_test.go index 0c543f0ca..6394e9e74 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node_profile_test.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_host_transport_node_test.go b/nsxt/data_source_nsxt_policy_host_transport_node_test.go index 873cd97bb..f4a5f24ad 100644 --- a/nsxt/data_source_nsxt_policy_host_transport_node_test.go +++ b/nsxt/data_source_nsxt_policy_host_transport_node_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_intrusion_service_profile.go b/nsxt/data_source_nsxt_policy_intrusion_service_profile.go index 68fe51178..23668b5f1 100644 --- a/nsxt/data_source_nsxt_policy_intrusion_service_profile.go +++ b/nsxt/data_source_nsxt_policy_intrusion_service_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_intrusion_service_profile_test.go b/nsxt/data_source_nsxt_policy_intrusion_service_profile_test.go index 286f80b9d..dc99771df 100644 --- a/nsxt/data_source_nsxt_policy_intrusion_service_profile_test.go +++ b/nsxt/data_source_nsxt_policy_intrusion_service_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_block.go b/nsxt/data_source_nsxt_policy_ip_block.go index 78e4f283a..ee08b7448 100644 --- a/nsxt/data_source_nsxt_policy_ip_block.go +++ b/nsxt/data_source_nsxt_policy_ip_block.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_block_test.go b/nsxt/data_source_nsxt_policy_ip_block_test.go index 058a36ca2..a3ee37896 100644 --- a/nsxt/data_source_nsxt_policy_ip_block_test.go +++ b/nsxt/data_source_nsxt_policy_ip_block_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_discovery_profile.go b/nsxt/data_source_nsxt_policy_ip_discovery_profile.go index 739222002..7fa79cdcc 100644 --- a/nsxt/data_source_nsxt_policy_ip_discovery_profile.go +++ b/nsxt/data_source_nsxt_policy_ip_discovery_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go b/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go index a5c9c8dde..38328c783 100644 --- a/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ip_discovery_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_pool.go b/nsxt/data_source_nsxt_policy_ip_pool.go index 0de9a4bc8..892ae39a2 100644 --- a/nsxt/data_source_nsxt_policy_ip_pool.go +++ b/nsxt/data_source_nsxt_policy_ip_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ip_pool_test.go b/nsxt/data_source_nsxt_policy_ip_pool_test.go index 92ee31b7d..95979b9ae 100644 --- a/nsxt/data_source_nsxt_policy_ip_pool_test.go +++ b/nsxt/data_source_nsxt_policy_ip_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint.go b/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint.go index 014d6e75d..27407e1f6 100644 --- a/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint.go +++ b/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint_test.go b/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint_test.go index a1ab89511..d8ecdba6c 100644 --- a/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint_test.go +++ b/nsxt/data_source_nsxt_policy_ipsec_vpn_local_endpoint_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipsec_vpn_service.go b/nsxt/data_source_nsxt_policy_ipsec_vpn_service.go index 183887e1c..4b8957202 100644 --- a/nsxt/data_source_nsxt_policy_ipsec_vpn_service.go +++ b/nsxt/data_source_nsxt_policy_ipsec_vpn_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipsec_vpn_service_test.go b/nsxt/data_source_nsxt_policy_ipsec_vpn_service_test.go index a7da2fdf3..0f1893130 100644 --- a/nsxt/data_source_nsxt_policy_ipsec_vpn_service_test.go +++ b/nsxt/data_source_nsxt_policy_ipsec_vpn_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipv6_dad_profile.go b/nsxt/data_source_nsxt_policy_ipv6_dad_profile.go index c2432f9c4..557e23de7 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_dad_profile.go +++ b/nsxt/data_source_nsxt_policy_ipv6_dad_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go b/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go index a35274a78..0cb8a3903 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ipv6_dad_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile.go b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile.go index b0890b911..0f3743a9c 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile.go +++ b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go index ca78cb21d..6a225b47b 100644 --- a/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go +++ b/nsxt/data_source_nsxt_policy_ipv6_ndra_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_l2_vpn_service.go b/nsxt/data_source_nsxt_policy_l2_vpn_service.go index 5598d050d..8004a02f8 100644 --- a/nsxt/data_source_nsxt_policy_l2_vpn_service.go +++ b/nsxt/data_source_nsxt_policy_l2_vpn_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_l2_vpn_service_test.go b/nsxt/data_source_nsxt_policy_l2_vpn_service_test.go index 018fbc22e..e22212170 100644 --- a/nsxt/data_source_nsxt_policy_l2_vpn_service_test.go +++ b/nsxt/data_source_nsxt_policy_l2_vpn_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_app_profile.go b/nsxt/data_source_nsxt_policy_lb_app_profile.go index 47fecfc30..2524358a6 100644 --- a/nsxt/data_source_nsxt_policy_lb_app_profile.go +++ b/nsxt/data_source_nsxt_policy_lb_app_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_app_profile_test.go b/nsxt/data_source_nsxt_policy_lb_app_profile_test.go index cec0b200a..b3f63e0b1 100644 --- a/nsxt/data_source_nsxt_policy_lb_app_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_app_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile.go b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile.go index 5c7e4990a..c31a99274 100644 --- a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile.go +++ b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go index 47dbbcc22..01d53705d 100644 --- a/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_client_ssl_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_monitor.go b/nsxt/data_source_nsxt_policy_lb_monitor.go index 035c17cc6..37e2a7560 100644 --- a/nsxt/data_source_nsxt_policy_lb_monitor.go +++ b/nsxt/data_source_nsxt_policy_lb_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_monitor_test.go b/nsxt/data_source_nsxt_policy_lb_monitor_test.go index 9e5f1cc46..dd67f648f 100644 --- a/nsxt/data_source_nsxt_policy_lb_monitor_test.go +++ b/nsxt/data_source_nsxt_policy_lb_monitor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_persistence_profile.go b/nsxt/data_source_nsxt_policy_lb_persistence_profile.go index 1beab2257..6b96af43c 100644 --- a/nsxt/data_source_nsxt_policy_lb_persistence_profile.go +++ b/nsxt/data_source_nsxt_policy_lb_persistence_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go b/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go index 3326614e0..de4db4f43 100644 --- a/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_persistence_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile.go b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile.go index c4a5c942e..e4ce120f3 100644 --- a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile.go +++ b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go index a266f3688..365357e2b 100644 --- a/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go +++ b/nsxt/data_source_nsxt_policy_lb_server_ssl_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_service.go b/nsxt/data_source_nsxt_policy_lb_service.go index 003e2a861..e36826499 100644 --- a/nsxt/data_source_nsxt_policy_lb_service.go +++ b/nsxt/data_source_nsxt_policy_lb_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_lb_service_test.go b/nsxt/data_source_nsxt_policy_lb_service_test.go index ba2cda93c..6e04ae969 100644 --- a/nsxt/data_source_nsxt_policy_lb_service_test.go +++ b/nsxt/data_source_nsxt_policy_lb_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_mac_discovery_profile.go b/nsxt/data_source_nsxt_policy_mac_discovery_profile.go index 6aafbd9ff..56ba4a59b 100644 --- a/nsxt/data_source_nsxt_policy_mac_discovery_profile.go +++ b/nsxt/data_source_nsxt_policy_mac_discovery_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go b/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go index f09c7aaa2..e506484dd 100644 --- a/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go +++ b/nsxt/data_source_nsxt_policy_mac_discovery_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_project.go b/nsxt/data_source_nsxt_policy_project.go index 70ef70d81..4922c8971 100644 --- a/nsxt/data_source_nsxt_policy_project.go +++ b/nsxt/data_source_nsxt_policy_project.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_project_test.go b/nsxt/data_source_nsxt_policy_project_test.go index 9e34cf14b..f3dddd34e 100644 --- a/nsxt/data_source_nsxt_policy_project_test.go +++ b/nsxt/data_source_nsxt_policy_project_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_qos_profile.go b/nsxt/data_source_nsxt_policy_qos_profile.go index 1f236b7cd..afcc75583 100644 --- a/nsxt/data_source_nsxt_policy_qos_profile.go +++ b/nsxt/data_source_nsxt_policy_qos_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_qos_profile_test.go b/nsxt/data_source_nsxt_policy_qos_profile_test.go index 84b1f5382..f67bff859 100644 --- a/nsxt/data_source_nsxt_policy_qos_profile_test.go +++ b/nsxt/data_source_nsxt_policy_qos_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_realization_info.go b/nsxt/data_source_nsxt_policy_realization_info.go index 8b0359d0a..99470eb2a 100644 --- a/nsxt/data_source_nsxt_policy_realization_info.go +++ b/nsxt/data_source_nsxt_policy_realization_info.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_realization_info_test.go b/nsxt/data_source_nsxt_policy_realization_info_test.go index 12b57dfba..b5389527e 100644 --- a/nsxt/data_source_nsxt_policy_realization_info_test.go +++ b/nsxt/data_source_nsxt_policy_realization_info_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_security_policy.go b/nsxt/data_source_nsxt_policy_security_policy.go index ad5cddfcd..02c6d5e55 100644 --- a/nsxt/data_source_nsxt_policy_security_policy.go +++ b/nsxt/data_source_nsxt_policy_security_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_security_policy_test.go b/nsxt/data_source_nsxt_policy_security_policy_test.go index 9df88b0af..d8c1ab6cd 100644 --- a/nsxt/data_source_nsxt_policy_security_policy_test.go +++ b/nsxt/data_source_nsxt_policy_security_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment.go b/nsxt/data_source_nsxt_policy_segment.go index 430e47fac..d4c4baa9b 100644 --- a/nsxt/data_source_nsxt_policy_segment.go +++ b/nsxt/data_source_nsxt_policy_segment.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment_realization.go b/nsxt/data_source_nsxt_policy_segment_realization.go index 0c8a3924a..7ada0c781 100644 --- a/nsxt/data_source_nsxt_policy_segment_realization.go +++ b/nsxt/data_source_nsxt_policy_segment_realization.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment_realization_test.go b/nsxt/data_source_nsxt_policy_segment_realization_test.go index a368eac96..2747c5dd7 100644 --- a/nsxt/data_source_nsxt_policy_segment_realization_test.go +++ b/nsxt/data_source_nsxt_policy_segment_realization_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment_security_profile.go b/nsxt/data_source_nsxt_policy_segment_security_profile.go index 48ba9fef4..c07d72b1c 100644 --- a/nsxt/data_source_nsxt_policy_segment_security_profile.go +++ b/nsxt/data_source_nsxt_policy_segment_security_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment_security_profile_test.go b/nsxt/data_source_nsxt_policy_segment_security_profile_test.go index 4526939f2..19031a758 100644 --- a/nsxt/data_source_nsxt_policy_segment_security_profile_test.go +++ b/nsxt/data_source_nsxt_policy_segment_security_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_segment_test.go b/nsxt/data_source_nsxt_policy_segment_test.go index 04f5c8a7c..90d61ef0e 100644 --- a/nsxt/data_source_nsxt_policy_segment_test.go +++ b/nsxt/data_source_nsxt_policy_segment_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_service.go b/nsxt/data_source_nsxt_policy_service.go index b2ef330fa..0790fbb8b 100644 --- a/nsxt/data_source_nsxt_policy_service.go +++ b/nsxt/data_source_nsxt_policy_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_service_test.go b/nsxt/data_source_nsxt_policy_service_test.go index 227fe8587..5b071c06d 100644 --- a/nsxt/data_source_nsxt_policy_service_test.go +++ b/nsxt/data_source_nsxt_policy_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_services.go b/nsxt/data_source_nsxt_policy_services.go new file mode 100644 index 000000000..c8d121865 --- /dev/null +++ b/nsxt/data_source_nsxt_policy_services.go @@ -0,0 +1,47 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + +package nsxt + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/vmware/terraform-provider-nsxt/api/infra" +) + +func dataSourceNsxtPolicyServices() *schema.Resource { + return &schema.Resource{ + Read: dataSourceNsxtPolicyServicesRead, + + Schema: map[string]*schema.Schema{ + "context": getContextSchema(false, false, false), + "items": { + Type: schema.TypeMap, + Description: "Mapping of services policy path by display name", + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func dataSourceNsxtPolicyServicesRead(d *schema.ResourceData, m interface{}) error { + connector := getPolicyConnector(m) + client := infra.NewServicesClient(getSessionContext(d, m), connector) + + servicesMap := make(map[string]string) + results, err := client.List(nil, nil, nil, nil, nil, nil, nil) + if err != nil { + return err + } + for _, r := range results.Results { + servicesMap[*r.DisplayName] = *r.Path + } + + d.Set("items", servicesMap) + d.SetId(newUUID()) + return nil +} diff --git a/nsxt/data_source_nsxt_policy_services_test.go b/nsxt/data_source_nsxt_policy_services_test.go new file mode 100644 index 000000000..7295dc356 --- /dev/null +++ b/nsxt/data_source_nsxt_policy_services_test.go @@ -0,0 +1,69 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + +package nsxt + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceNsxtPolicyServices_basic(t *testing.T) { + testAccDataSourceNsxtPolicyServicesBasic(t, false, func() { + testAccPreCheck(t) + }) +} + +func TestAccDataSourceNsxtPolicyServices_multitenancy(t *testing.T) { + testAccDataSourceNsxtPolicyServicesBasic(t, true, func() { + testAccPreCheck(t) + testAccOnlyMultitenancy(t) + }) +} + +func testAccDataSourceNsxtPolicyServicesBasic(t *testing.T, withContext bool, preCheck func()) { + serviceName := getAccTestDataSourceName() + testResourceName := "data.nsxt_policy_services.test" + checkResourceName := "data.nsxt_policy_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: preCheck, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccNSXPolicyServicesReadTemplate(serviceName, withContext), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(testResourceName, "id"), + resource.TestCheckResourceAttr(checkResourceName, "display_name", serviceName), + ), + }, + }, + }) +} + +func testAccNSXPolicyServicesReadTemplate(serviceName string, withContext bool) string { + context := "" + if withContext { + context = testAccNsxtPolicyMultitenancyContext() + } + return testAccNsxtPolicyIcmpTypeServiceCreateTypeCodeTemplate(serviceName, "3", "1", "ICMPv4", withContext) + fmt.Sprintf(` +data "nsxt_policy_services" "test" { + depends_on = [nsxt_policy_service.test] +%s +} + +locals { +// Get id from path + path_split = split("/", data.nsxt_policy_services.test.items["%s"]) + service_id = element(local.path_split, length(local.path_split) - 1) +} + +data "nsxt_policy_service" "test" { +%s + id = local.service_id +} +`, context, serviceName, context) +} diff --git a/nsxt/data_source_nsxt_policy_site.go b/nsxt/data_source_nsxt_policy_site.go index 5ef2468bc..3a4425228 100644 --- a/nsxt/data_source_nsxt_policy_site.go +++ b/nsxt/data_source_nsxt_policy_site.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_site_test.go b/nsxt/data_source_nsxt_policy_site_test.go index 15e873256..9cef1ceb9 100644 --- a/nsxt/data_source_nsxt_policy_site_test.go +++ b/nsxt/data_source_nsxt_policy_site_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_spoofguard_profile.go b/nsxt/data_source_nsxt_policy_spoofguard_profile.go index 2dd1d540e..73bdec45d 100644 --- a/nsxt/data_source_nsxt_policy_spoofguard_profile.go +++ b/nsxt/data_source_nsxt_policy_spoofguard_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go b/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go index 6928bf63b..6572c1de6 100644 --- a/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go +++ b/nsxt/data_source_nsxt_policy_spoofguard_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_tier0_gateway.go b/nsxt/data_source_nsxt_policy_tier0_gateway.go index 5107abd2a..775ed34eb 100644 --- a/nsxt/data_source_nsxt_policy_tier0_gateway.go +++ b/nsxt/data_source_nsxt_policy_tier0_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_tier0_gateway_test.go b/nsxt/data_source_nsxt_policy_tier0_gateway_test.go index 6cec42eec..16ba162c7 100644 --- a/nsxt/data_source_nsxt_policy_tier0_gateway_test.go +++ b/nsxt/data_source_nsxt_policy_tier0_gateway_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_tier1_gateway.go b/nsxt/data_source_nsxt_policy_tier1_gateway.go index 8035d64ef..87242deb5 100644 --- a/nsxt/data_source_nsxt_policy_tier1_gateway.go +++ b/nsxt/data_source_nsxt_policy_tier1_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_tier1_gateway_test.go b/nsxt/data_source_nsxt_policy_tier1_gateway_test.go index 125104780..5f07db284 100644 --- a/nsxt/data_source_nsxt_policy_tier1_gateway_test.go +++ b/nsxt/data_source_nsxt_policy_tier1_gateway_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_transit_gateway.go b/nsxt/data_source_nsxt_policy_transit_gateway.go index 6552c31ad..22564b3e4 100644 --- a/nsxt/data_source_nsxt_policy_transit_gateway.go +++ b/nsxt/data_source_nsxt_policy_transit_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_transit_gateway_nat.go b/nsxt/data_source_nsxt_policy_transit_gateway_nat.go index 04e071592..9485550b1 100644 --- a/nsxt/data_source_nsxt_policy_transit_gateway_nat.go +++ b/nsxt/data_source_nsxt_policy_transit_gateway_nat.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -39,11 +40,13 @@ func dataSourceNsxtPolicyTransitGatewayNat() *schema.Resource { } } +var transitGatewayPathExample = "/orgs/[org]/projects/[project]/transit-gateways/[gateway]" + func dataSourceNsxtPolicyTransitGatewayNatRead(d *schema.ResourceData, m interface{}) error { connector := getPolicyConnector(m) parentPath := d.Get("transit_gateway_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return fmt.Errorf("invalid transit_gateway_path: %v", pathErr) } diff --git a/nsxt/data_source_nsxt_policy_transport_zone.go b/nsxt/data_source_nsxt_policy_transport_zone.go index b7c79fc49..963ccdd95 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone.go +++ b/nsxt/data_source_nsxt_policy_transport_zone.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_transport_zone_test.go b/nsxt/data_source_nsxt_policy_transport_zone_test.go index 82e7f95f5..a78d80968 100644 --- a/nsxt/data_source_nsxt_policy_transport_zone_test.go +++ b/nsxt/data_source_nsxt_policy_transport_zone_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go b/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go index 79f711398..b1bd6f893 100644 --- a/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go +++ b/nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vm.go b/nsxt/data_source_nsxt_policy_vm.go index 01d4919c1..187989594 100644 --- a/nsxt/data_source_nsxt_policy_vm.go +++ b/nsxt/data_source_nsxt_policy_vm.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vm_test.go b/nsxt/data_source_nsxt_policy_vm_test.go index 01f7a7bc3..49732ccd7 100644 --- a/nsxt/data_source_nsxt_policy_vm_test.go +++ b/nsxt/data_source_nsxt_policy_vm_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vms.go b/nsxt/data_source_nsxt_policy_vms.go index 3ee1cd002..564754280 100644 --- a/nsxt/data_source_nsxt_policy_vms.go +++ b/nsxt/data_source_nsxt_policy_vms.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vms_test.go b/nsxt/data_source_nsxt_policy_vms_test.go index 824ec386b..c2a514af5 100644 --- a/nsxt/data_source_nsxt_policy_vms_test.go +++ b/nsxt/data_source_nsxt_policy_vms_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vni_pool.go b/nsxt/data_source_nsxt_policy_vni_pool.go index 4d8989b5b..8eed0a8d7 100644 --- a/nsxt/data_source_nsxt_policy_vni_pool.go +++ b/nsxt/data_source_nsxt_policy_vni_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vni_pool_test.go b/nsxt/data_source_nsxt_policy_vni_pool_test.go index 10d2c2615..88a8a67d7 100644 --- a/nsxt/data_source_nsxt_policy_vni_pool_test.go +++ b/nsxt/data_source_nsxt_policy_vni_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_policy_vtep_ha_host_switch_profile.go b/nsxt/data_source_nsxt_policy_vtep_ha_host_switch_profile.go index 5d8357ffb..7caaae55e 100644 --- a/nsxt/data_source_nsxt_policy_vtep_ha_host_switch_profile.go +++ b/nsxt/data_source_nsxt_policy_vtep_ha_host_switch_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_project_ip_address_allocation.go b/nsxt/data_source_nsxt_project_ip_address_allocation.go index 0a9f865b5..ea845541f 100644 --- a/nsxt/data_source_nsxt_project_ip_address_allocation.go +++ b/nsxt/data_source_nsxt_project_ip_address_allocation.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_provider_info.go b/nsxt/data_source_nsxt_provider_info.go index 0c6cb5a48..adca02b04 100644 --- a/nsxt/data_source_nsxt_provider_info.go +++ b/nsxt/data_source_nsxt_provider_info.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_switching_profile.go b/nsxt/data_source_nsxt_switching_profile.go index 7c14f0725..36542567a 100644 --- a/nsxt/data_source_nsxt_switching_profile.go +++ b/nsxt/data_source_nsxt_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_switching_profile_test.go b/nsxt/data_source_nsxt_switching_profile_test.go index e38736f3a..4b88a69b3 100644 --- a/nsxt/data_source_nsxt_switching_profile_test.go +++ b/nsxt/data_source_nsxt_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_transport_node.go b/nsxt/data_source_nsxt_transport_node.go index b685ac84d..41100955c 100644 --- a/nsxt/data_source_nsxt_transport_node.go +++ b/nsxt/data_source_nsxt_transport_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_transport_node_realization.go b/nsxt/data_source_nsxt_transport_node_realization.go index a25a1d4d7..a3f7fb4f6 100644 --- a/nsxt/data_source_nsxt_transport_node_realization.go +++ b/nsxt/data_source_nsxt_transport_node_realization.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_transport_node_test.go b/nsxt/data_source_nsxt_transport_node_test.go index 0760a6334..5f56aae1f 100644 --- a/nsxt/data_source_nsxt_transport_node_test.go +++ b/nsxt/data_source_nsxt_transport_node_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_transport_zone.go b/nsxt/data_source_nsxt_transport_zone.go index 12663f371..4bf4432dd 100644 --- a/nsxt/data_source_nsxt_transport_zone.go +++ b/nsxt/data_source_nsxt_transport_zone.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_transport_zone_test.go b/nsxt/data_source_nsxt_transport_zone_test.go index 315369218..7fb6f4c20 100644 --- a/nsxt/data_source_nsxt_transport_zone_test.go +++ b/nsxt/data_source_nsxt_transport_zone_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_upgrade_postcheck.go b/nsxt/data_source_nsxt_upgrade_postcheck.go index 285038bfa..bda170c07 100644 --- a/nsxt/data_source_nsxt_upgrade_postcheck.go +++ b/nsxt/data_source_nsxt_upgrade_postcheck.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_upgrade_prepare_ready.go b/nsxt/data_source_nsxt_upgrade_prepare_ready.go index 16e6922be..5ba7db47a 100644 --- a/nsxt/data_source_nsxt_upgrade_prepare_ready.go +++ b/nsxt/data_source_nsxt_upgrade_prepare_ready.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc.go b/nsxt/data_source_nsxt_vpc.go index 04b7a25a3..8315f1df3 100644 --- a/nsxt/data_source_nsxt_vpc.go +++ b/nsxt/data_source_nsxt_vpc.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_connectivity_profile.go b/nsxt/data_source_nsxt_vpc_connectivity_profile.go index 420d56476..cfa9bfd3d 100644 --- a/nsxt/data_source_nsxt_vpc_connectivity_profile.go +++ b/nsxt/data_source_nsxt_vpc_connectivity_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_group.go b/nsxt/data_source_nsxt_vpc_group.go index 4519ffbba..ef08a9075 100644 --- a/nsxt/data_source_nsxt_vpc_group.go +++ b/nsxt/data_source_nsxt_vpc_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_ip_address_allocation.go b/nsxt/data_source_nsxt_vpc_ip_address_allocation.go index 2ae7efe82..698bb1d06 100644 --- a/nsxt/data_source_nsxt_vpc_ip_address_allocation.go +++ b/nsxt/data_source_nsxt_vpc_ip_address_allocation.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_nat.go b/nsxt/data_source_nsxt_vpc_nat.go index d877480c1..4d2ce9476 100644 --- a/nsxt/data_source_nsxt_vpc_nat.go +++ b/nsxt/data_source_nsxt_vpc_nat.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_service_profile.go b/nsxt/data_source_nsxt_vpc_service_profile.go index 8d281a63a..b04fde8ed 100644 --- a/nsxt/data_source_nsxt_vpc_service_profile.go +++ b/nsxt/data_source_nsxt_vpc_service_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_subnet.go b/nsxt/data_source_nsxt_vpc_subnet.go index 786dba89b..393ef5255 100644 --- a/nsxt/data_source_nsxt_vpc_subnet.go +++ b/nsxt/data_source_nsxt_vpc_subnet.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_subnet_port.go b/nsxt/data_source_nsxt_vpc_subnet_port.go index cba432ee2..c390346a6 100644 --- a/nsxt/data_source_nsxt_vpc_subnet_port.go +++ b/nsxt/data_source_nsxt_vpc_subnet_port.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -38,10 +39,12 @@ func dataSourceNsxtVpcSubnetPort() *schema.Resource { } } +var vpcSubnetPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/subnets/[subnet]" + func listVpcSubnetPorts(connector client.Connector, subnetPath string) ([]model.VpcSubnetPort, error) { var results []model.VpcSubnetPort - parents, pathErr := parseStandardPolicyPathVerifySize(subnetPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(subnetPath, 4, vpcSubnetPathExample) if pathErr != nil { return results, pathErr } diff --git a/nsxt/data_source_nsxt_vpc_subnet_port_test.go b/nsxt/data_source_nsxt_vpc_subnet_port_test.go index f87348cac..0a7fcdc6f 100644 --- a/nsxt/data_source_nsxt_vpc_subnet_port_test.go +++ b/nsxt/data_source_nsxt_vpc_subnet_port_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/data_source_nsxt_vpc_test.go b/nsxt/data_source_nsxt_vpc_test.go index 5731935e9..80ca3cd71 100644 --- a/nsxt/data_source_nsxt_vpc_test.go +++ b/nsxt/data_source_nsxt_vpc_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/gateway_common.go b/nsxt/gateway_common.go index 50824204f..b4ba76d69 100644 --- a/nsxt/gateway_common.go +++ b/nsxt/gateway_common.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/lb_rule_utils.go b/nsxt/lb_rule_utils.go index 960d3e8dc..c1015dc4f 100644 --- a/nsxt/lb_rule_utils.go +++ b/nsxt/lb_rule_utils.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/lb_utils.go b/nsxt/lb_utils.go index 5b3da2f31..168db08e8 100644 --- a/nsxt/lb_utils.go +++ b/nsxt/lb_utils.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/metadata/metadata.go b/nsxt/metadata/metadata.go index e3d66ef11..3d1b45ccf 100644 --- a/nsxt/metadata/metadata.go +++ b/nsxt/metadata/metadata.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package metadata import ( @@ -69,6 +73,13 @@ type TypeIdentifier struct { APIFieldName string } +func metadataTraceLogger(format string, v ...any) { + if os.Getenv("TF_LOG_METADATA_DEBUGGING") != "" { + f := fmt.Sprintf("[TRACE] %s", format) + log.Printf(f, v) + } +} + // GetSdkName returns the SDK field type identifier // Defaults to ResourceType func (t TypeIdentifier) GetSdkName() string { @@ -103,7 +114,7 @@ func GetSchemaFromExtendedSchema(ext map[string]*ExtendedSchema) map[string]*sch result := make(map[string]*schema.Schema) for key, value := range ext { - logger.Printf("[TRACE] inspecting schema key %s, value %v", key, value) + metadataTraceLogger("inspecting schema key %s, value %v", key, value) shallowCopy := value.Schema if (value.Schema.Type == schema.TypeList) || (value.Schema.Type == schema.TypeSet) { elem, ok := shallowCopy.Elem.(*ExtendedSchema) @@ -149,9 +160,9 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str continue } - logger.Printf("[TRACE] %s inspecting key %s", ctx, key) + metadataTraceLogger("%s inspecting key %s", ctx, key) if len(parent) > 0 { - logger.Printf("[TRACE] %s parent %s key %s", ctx, parent, key) + metadataTraceLogger("%s parent %s key %s", ctx, parent, key) } if !elem.FieldByName(item.Metadata.SdkFieldName).IsValid() { // FieldByName can't find the field by name @@ -162,7 +173,7 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str return } if elem.FieldByName(item.Metadata.SdkFieldName).IsNil() { - logger.Printf("[TRACE] %s skip key %s with nil value", ctx, key) + metadataTraceLogger("%s skip key %s with nil value", ctx, key) continue } if len(item.Metadata.PolymorphicType) > 0 { @@ -186,7 +197,7 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str } else { d.Set(key, nestedVal) } - logger.Printf("[TRACE] %s adding polymorphic slice %+v to key %s", ctx, nestedVal, key) + metadataTraceLogger("%s adding polymorphic slice %+v to key %s", ctx, nestedVal, key) continue } if item.Metadata.SchemaType == "struct" { @@ -196,7 +207,7 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str if err = StructToSchema(nestedObj.Elem(), d, childElem.Schema, key, nestedSchema); err != nil { return } - logger.Printf("[TRACE] %s assigning struct %+v to %s", ctx, nestedObj, key) + metadataTraceLogger("%s assigning struct %+v to %s", ctx, nestedObj, key) var nestedSlice []map[string]interface{} nestedSlice = append(nestedSlice, nestedSchema) if len(parent) > 0 { @@ -208,7 +219,7 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str if _, ok := item.Schema.Elem.(*ExtendedSchema); ok { // List of string, bool, int nestedSlice := elem.FieldByName(item.Metadata.SdkFieldName) - logger.Printf("[TRACE] %s assigning slice %v to %s", ctx, nestedSlice.Interface(), key) + metadataTraceLogger("%s assigning slice %v to %s", ctx, nestedSlice.Interface(), key) if len(parent) > 0 { parentMap[key] = nestedSlice.Interface() } else { @@ -224,7 +235,7 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str return } nestedSlice = append(nestedSlice, nestedSchema) - logger.Printf("[TRACE] %s appending slice item %+v to %s", ctx, nestedSchema, key) + metadataTraceLogger("%s appending slice item %+v to %s", ctx, nestedSchema, key) } if len(parent) > 0 { parentMap[key] = nestedSlice @@ -234,11 +245,11 @@ func StructToSchema(elem reflect.Value, d *schema.ResourceData, metadata map[str } } else { if len(parent) > 0 { - logger.Printf("[TRACE] %s assigning nested value %+v to %s", + metadataTraceLogger("%s assigning nested value %+v to %s", ctx, elem.FieldByName(item.Metadata.SdkFieldName).Interface(), key) parentMap[key] = elem.FieldByName(item.Metadata.SdkFieldName).Interface() } else { - logger.Printf("[TRACE] %s assigning value %+v to %s", + metadataTraceLogger("%s assigning value %+v to %s", ctx, elem.FieldByName(item.Metadata.SdkFieldName).Interface(), key) d.Set(key, elem.FieldByName(item.Metadata.SdkFieldName).Interface()) } @@ -261,15 +272,15 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str for key, item := range metadata { if item.Metadata.ReadOnly { - logger.Printf("[TRACE] %s skip key %s as read only", ctx, key) + metadataTraceLogger("%s skip key %s as read only", ctx, key) continue } if item.Metadata.Skip { - logger.Printf("[TRACE] %s skip key %s", ctx, key) + metadataTraceLogger("%s skip key %s", ctx, key) continue } if item.Metadata.IntroducedInVersion != "" && util.NsxVersionLower(item.Metadata.IntroducedInVersion) { - logger.Printf("[TRACE] %s skip key %s as NSX version is lower than %v", ctx, key, item.Metadata.IntroducedInVersion) + metadataTraceLogger("%s skip key %s as NSX version is lower than %v", ctx, key, item.Metadata.IntroducedInVersion) continue } if !elem.FieldByName(item.Metadata.SdkFieldName).IsValid() { @@ -281,12 +292,12 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str return } - logger.Printf("[TRACE] %s inspecting key %s with type %s", ctx, key, item.Metadata.SchemaType) + metadataTraceLogger("%s inspecting key %s with type %s", ctx, key, item.Metadata.SchemaType) if len(parent) > 0 { - logger.Printf("[TRACE] %s parent %s key %s", ctx, parent, key) + metadataTraceLogger("%s parent %s key %s", ctx, parent, key) } if len(item.Metadata.PolymorphicType) > 0 { - logger.Printf("[TRACE] %s inspecting polymorphic key %s", ctx, key) + metadataTraceLogger("%s inspecting polymorphic key %s", ctx, key) itemList := getItemListForSchemaToStruct(d, item.Metadata.SchemaType, key, parent, parentMap) switch item.Metadata.PolymorphicType { case PolymorphicTypeNested: @@ -320,10 +331,10 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str } } if item.Metadata.OmitIfEmpty && !exists { - logger.Printf("[TRACE] %s skip key %s since its empty and OmitIfEmpty is true", ctx, key) + metadataTraceLogger("%s skip key %s since its empty and OmitIfEmpty is true", ctx, key) continue } - logger.Printf("[TRACE] %s assigning string %v to %s", ctx, value, key) + metadataTraceLogger("%s assigning string %v to %s", ctx, value, key) elem.FieldByName(item.Metadata.SdkFieldName).Set(reflect.ValueOf(&value)) } if item.Metadata.SchemaType == "bool" { @@ -340,10 +351,10 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str } } if item.Metadata.OmitIfEmpty && !exists { - logger.Printf("[TRACE] %s skip key %s since its empty and OmitIfEmpty is true", ctx, key) + metadataTraceLogger("%s skip key %s since its empty and OmitIfEmpty is true", ctx, key) continue } - logger.Printf("[TRACE] %s assigning bool %v to %s", ctx, value, key) + metadataTraceLogger("%s assigning bool %v to %s", ctx, value, key) elem.FieldByName(item.Metadata.SdkFieldName).Set(reflect.ValueOf(&value)) } if item.Metadata.SchemaType == "int" { @@ -360,22 +371,22 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str } } if item.Metadata.OmitIfEmpty && value == 0 && !exists { - logger.Printf("[TRACE] %s skip key %s since its empty and OmitIfEmpty is true", ctx, key) + metadataTraceLogger("%s skip key %s since its empty and OmitIfEmpty is true", ctx, key) continue } - logger.Printf("[TRACE] %s assigning int %v to %s", ctx, value, key) + metadataTraceLogger("%s assigning int %v to %s", ctx, value, key) elem.FieldByName(item.Metadata.SdkFieldName).Set(reflect.ValueOf(&value)) } if item.Metadata.SchemaType == "struct" { nestedObj := reflect.New(item.Metadata.ReflectType) itemList := getItemListForSchemaToStruct(d, item.Metadata.SchemaType, key, parent, parentMap) if len(itemList) == 0 { - logger.Printf("[TRACE] Item list empty") + metadataTraceLogger("Item list empty") continue } if itemList[0] == nil { // empty clause is specified - logger.Printf("[TRACE] Item list contains empty value") + metadataTraceLogger("Item list contains empty value") continue } nestedSchema := itemList[0].(map[string]interface{}) @@ -384,7 +395,7 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str if err = SchemaToStruct(nestedObj.Elem(), d, childElem.Schema, key, nestedSchema); err != nil { return } - logger.Printf("[TRACE] %s assigning struct %v to %s", ctx, nestedObj, key) + metadataTraceLogger("%s assigning struct %v to %s", ctx, nestedObj, key) elem.FieldByName(item.Metadata.SdkFieldName).Set(nestedObj) } if item.Metadata.SchemaType == "list" || item.Metadata.SchemaType == "set" { @@ -413,7 +424,7 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str } else { sliceElem.Index(i).Set(reflect.ValueOf(v)) } - logger.Printf("[TRACE] %s appending %v to %s", ctx, v, key) + metadataTraceLogger("%s appending %v to %s", ctx, v, key) } } @@ -432,7 +443,7 @@ func SchemaToStruct(elem reflect.Value, d *schema.ResourceData, metadata map[str return } sliceElem.Index(i).Set(nestedObj.Elem()) - logger.Printf("[TRACE] %s appending %+v to %s", ctx, nestedObj.Elem(), key) + metadataTraceLogger("%s appending %+v to %s", ctx, nestedObj.Elem(), key) } } } @@ -564,7 +575,7 @@ func polyStructToNestedSchema(ctx string, elem reflect.Value, item *ExtendedSche } sliceValue[i] = make(map[string]interface{}) sliceValue[i][key] = []interface{}{nestedSchema} - logger.Printf("[TRACE] %s adding %+v of key %s", ctx, dv, key) + metadataTraceLogger("%s adding %+v of key %s", ctx, dv, key) } ret = sliceValue @@ -613,7 +624,7 @@ func polyNestedSchemaToStruct(ctx string, elem reflect.Value, dataList []interfa return } dv[i] = dataValue.(*data.StructValue) - logger.Printf("[TRACE] %s adding polymorphic value %+v to %s", + metadataTraceLogger("%s adding polymorphic value %+v to %s", ctx, nestedObj.Interface(), item.Metadata.SdkFieldName) // there should be only one non-empty entry in the map @@ -718,7 +729,7 @@ func polyFlattenSchemaToStruct(ctx string, elem reflect.Value, key string, dataL return } rSlice.Index(i).Set(reflect.ValueOf(dataValue.(*data.StructValue))) - logger.Printf("[TRACE] %s adding polymorphic value %+v to %s", + metadataTraceLogger("%s adding polymorphic value %+v to %s", ctx, nestedObj.Interface(), item.Metadata.SdkFieldName) } diff --git a/nsxt/metadata/metadata_poly_test.go b/nsxt/metadata/metadata_poly_test.go index 6306b5d76..d6026989b 100644 --- a/nsxt/metadata/metadata_poly_test.go +++ b/nsxt/metadata/metadata_poly_test.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package metadata import ( diff --git a/nsxt/metadata/metadata_test.go b/nsxt/metadata/metadata_test.go index dc5940601..4dbc344aa 100644 --- a/nsxt/metadata/metadata_test.go +++ b/nsxt/metadata/metadata_test.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package metadata import ( diff --git a/nsxt/policy_common.go b/nsxt/policy_common.go index d6fd518ee..92b87d25b 100644 --- a/nsxt/policy_common.go +++ b/nsxt/policy_common.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/policy_errors.go b/nsxt/policy_errors.go index e6ee7f1aa..3743216a0 100644 --- a/nsxt/policy_errors.go +++ b/nsxt/policy_errors.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/policy_search.go b/nsxt/policy_search.go index 903db5e05..e1e4ed08c 100644 --- a/nsxt/policy_search.go +++ b/nsxt/policy_search.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/policy_utils.go b/nsxt/policy_utils.go index 32fb6c910..bdaf8c76a 100644 --- a/nsxt/policy_utils.go +++ b/nsxt/policy_utils.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -27,6 +28,7 @@ import ( // ErrNotAPolicyPath - Define an ignorable error for policy path importer - to indicate that the given path is not a // policy path and may be processed as an id - which is handy for legacy import method var ErrNotAPolicyPath = errors.New("specified import identifier is not a policy path") +var ErrUnexpectedPolicyPath = errors.New("unexpected policy path") var ErrEmptyImportID = errors.New("import identifier cannot be empty") func isSpaceString(s string) bool { @@ -342,13 +344,13 @@ func parseStandardPolicyPath(path string) ([]string, error) { return parents, nil } -func parseStandardPolicyPathVerifySize(path string, expectedSize int) ([]string, error) { +func parseStandardPolicyPathVerifySize(path string, expectedSize int, pathExample string) ([]string, error) { parents, err := parseStandardPolicyPath(path) if err != nil { return parents, err } if len(parents) != expectedSize { - return parents, fmt.Errorf("Unexpected parent path %s (expected %d parent ids, got %d)", path, expectedSize, len(parents)) + return parents, fmt.Errorf("Unexpected parent path %s (expected format %s)", path, pathExample) } return parents, nil @@ -410,32 +412,74 @@ func validateImportPolicyPath(policyPath string) error { return nil } -// This importer function accepts policy path and resource ID -func nsxtPolicyPathResourceImporter(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { - rd, err := nsxtPolicyPathResourceImporterHelper(d, m) - if errors.Is(err, ErrNotAPolicyPath) { - return rd, nil - } else if err != nil { - return rd, err +func isValidResourceID(id string) bool { + if isSpaceString(id) { + return false + } + if len(id) > 1024 { + return false + } + if strings.Contains(id, "/") { + return false } - return rd, nil + return true } // This importer function accepts policy path only as import ID -func nsxtPolicyPathOnlyResourceImporter(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { - return nsxtPolicyPathResourceImporterHelper(d, m) +func getPolicyPathResourceImporter(pathExample string) func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + return func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + rd, err := nsxtPolicyPathResourceImporterHelper(d, m) + if errors.Is(err, ErrNotAPolicyPath) || errors.Is(err, ErrUnexpectedPolicyPath) { + return rd, fmt.Errorf("Invalid policy path %s; expected format: %s", d.Id(), pathExample) + } else if err != nil { + return rd, err + } + return rd, nil + } } -func nsxtVPCPathResourceImporter(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { - rd, err := nsxtPolicyPathResourceImporterHelper(d, m) - if err != nil { - return rd, err +func getMultitenancyPathExample(pathExample string) string { + return fmt.Sprintf("%s or /orgs/[org]/projects/[project]%s", pathExample, pathExample) +} + +// This importer function accepts policy path or resource ID +func getPolicyPathOrIDResourceImporter(pathExample string) func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + return func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + rd, err := nsxtPolicyPathResourceImporterHelper(d, m) + if errors.Is(err, ErrUnexpectedPolicyPath) { + return rd, fmt.Errorf("Invalid policy path %s; expected format: %s", d.Id(), pathExample) + } + if errors.Is(err, ErrNotAPolicyPath) { + if !isValidResourceID(d.Id()) { + return rd, fmt.Errorf("Invalid policy path or id %s; when importing with path, expected format is %s", d.Id(), pathExample) + } + return rd, nil + } else if err != nil { + return rd, err + } + return rd, nil } - projectID, vpcID := getContextDataFromSchema(d) - if projectID == "" || vpcID == "" { - return rd, fmt.Errorf("imported resource policy path should have both project_id and vpc_id fields") +} + +// This importer function accepts VPC path only +func getVpcPathResourceImporter(pathExample string) func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + return func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { + rd, err := nsxtPolicyPathResourceImporterHelper(d, m) + if errors.Is(err, ErrNotAPolicyPath) || errors.Is(err, ErrUnexpectedPolicyPath) { + return rd, fmt.Errorf("Invalid policy path %s; expected format: %s", d.Id(), pathExample) + } + + if err != nil { + return rd, err + } + + // verify that both project and vpc were set in schema by the improter helper above + projectID, vpcID := getContextDataFromSchema(d) + if projectID == "" || vpcID == "" { + return rd, fmt.Errorf("imported resource policy path should have both project_id and vpc_id fields") + } + return rd, nil } - return rd, nil } func nsxtPolicyPathResourceImporterHelper(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) { @@ -636,7 +680,9 @@ func getElemOrEmptyMapFromSchema(d *schema.ResourceData, key string) map[string] if e != nil { elems := e.([]interface{}) if len(elems) > 0 { - return elems[0].(map[string]interface{}) + if elemMap, ok := elems[0].(map[string]interface{}); ok { + return elemMap + } } } return make(map[string]interface{}) @@ -647,7 +693,9 @@ func getElemOrEmptyMapFromMap(d map[string]interface{}, key string) map[string]i if e != nil { elems := e.([]interface{}) if len(elems) > 0 { - return elems[0].(map[string]interface{}) + if elemMap, ok := elems[0].(map[string]interface{}); ok { + return elemMap + } } } return make(map[string]interface{}) diff --git a/nsxt/policy_utils_test.go b/nsxt/policy_utils_test.go index bb84aa77d..acc1ad488 100644 --- a/nsxt/policy_utils_test.go +++ b/nsxt/policy_utils_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -90,13 +91,13 @@ func TestNegativeParseStandardPolicyPath(t *testing.T) { func TestParseStandardPolicyPathVerifySize(t *testing.T) { - _, err := parseStandardPolicyPathVerifySize("/infra/things/thing1/sub-things/sub-thing1", 3) + _, err := parseStandardPolicyPathVerifySize("/infra/things/thing1/sub-things/sub-thing1", 3, "sample") assert.NotNil(t, err) - parents, err := parseStandardPolicyPathVerifySize("/infra/things/thing1/sub-things/sub-thing1", 2) + parents, err := parseStandardPolicyPathVerifySize("/infra/things/thing1/sub-things/sub-thing1", 2, "sample") assert.Nil(t, err) assert.Equal(t, 2, len(parents)) - _, err = parseStandardPolicyPathVerifySize("/global-infra/things/1/sub-things/2/fine-tuned-thing/3", 1) + _, err = parseStandardPolicyPathVerifySize("/global-infra/things/1/sub-things/2/fine-tuned-thing/3", 1, "sample") assert.NotNil(t, err) } diff --git a/nsxt/provider.go b/nsxt/provider.go index 9c9d5a153..e328cba1f 100644 --- a/nsxt/provider.go +++ b/nsxt/provider.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -340,6 +341,8 @@ func Provider() *schema.Provider { "nsxt_vpc_ip_address_allocation": dataSourceNsxtVpcIpAddressAllocation(), "nsxt_policy_gateway_connection": dataSourceNsxtPolicyGatewayConnection(), "nsxt_policy_distributed_vlan_connection": dataSourceNsxtPolicyDistributedVlanConnection(), + "nsxt_policy_services": dataSourceNsxtPolicyServices(), + "nsxt_policy_groups": dataSourceNsxtPolicyGroups(), }, ResourcesMap: map[string]*schema.Resource{ diff --git a/nsxt/provider_test.go b/nsxt/provider_test.go index a072d328f..87ca7680e 100644 --- a/nsxt/provider_test.go +++ b/nsxt/provider_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/removed_resource_wrapper.go b/nsxt/removed_resource_wrapper.go index 16b2bf5cb..bb3343054 100644 --- a/nsxt/removed_resource_wrapper.go +++ b/nsxt/removed_resource_wrapper.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/resource_nsxt_algorithm_type_ns_service.go b/nsxt/resource_nsxt_algorithm_type_ns_service.go index c7e2ec060..c65637863 100644 --- a/nsxt/resource_nsxt_algorithm_type_ns_service.go +++ b/nsxt/resource_nsxt_algorithm_type_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_algorithm_type_ns_service_test.go b/nsxt/resource_nsxt_algorithm_type_ns_service_test.go index 32df42ea8..84cdfa063 100644 --- a/nsxt/resource_nsxt_algorithm_type_ns_service_test.go +++ b/nsxt/resource_nsxt_algorithm_type_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_cluster_virtual_ip.go b/nsxt/resource_nsxt_cluster_virtual_ip.go index 68cc61439..7019dbbc6 100644 --- a/nsxt/resource_nsxt_cluster_virtual_ip.go +++ b/nsxt/resource_nsxt_cluster_virtual_ip.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_compute_manager.go b/nsxt/resource_nsxt_compute_manager.go index 29ba4275f..eec7f82ea 100644 --- a/nsxt/resource_nsxt_compute_manager.go +++ b/nsxt/resource_nsxt_compute_manager.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -420,8 +421,14 @@ func setCredentialValuesInSchema(d *schema.ResourceData, credential *data.Struct return errs[0] } credEntry := entry.(model.SamlTokenLoginCredential) - elem["thumbprint"] = credEntry.Thumbprint - elem["token"] = credEntry.Token + // Normally NSX won't return sensitive info, in which case + // we need to keep values from intent to avoid permadiff + if credEntry.Thumbprint != nil { + elem["thumbprint"] = credEntry.Thumbprint + } + if credEntry.Token != nil { + elem["token"] = credEntry.Token + } parentElem["saml_login"] = []interface{}{elem} case model.SessionLoginCredential__TYPE_IDENTIFIER: @@ -431,8 +438,14 @@ func setCredentialValuesInSchema(d *schema.ResourceData, credential *data.Struct return errs[0] } credEntry := entry.(model.SessionLoginCredential) - elem["session_id"] = credEntry.SessionId - elem["thumbprint"] = credEntry.Thumbprint + // Normally NSX won't return sensitive info, in which case + // we need to keep values from intent to avoid permadiff + if credEntry.SessionId != nil { + elem["session_id"] = credEntry.SessionId + } + if credEntry.Thumbprint != nil { + elem["thumbprint"] = credEntry.Thumbprint + } parentElem["session_login"] = []interface{}{elem} case model.UsernamePasswordLoginCredential__TYPE_IDENTIFIER: @@ -442,15 +455,17 @@ func setCredentialValuesInSchema(d *schema.ResourceData, credential *data.Struct return errs[0] } credEntry := entry.(model.UsernamePasswordLoginCredential) - // Normally NSX won't return credEntry.Username + // Normally NSX won't return sensitive info, in which case + // we need to keep values from intent to avoid permadiff if credEntry.Username != nil { elem["username"] = credEntry.Username } - // Normally NSX won't return credEntry.Password if credEntry.Password != nil { elem["password"] = credEntry.Password } - elem["thumbprint"] = credEntry.Thumbprint + if credEntry.Thumbprint != nil { + elem["thumbprint"] = credEntry.Thumbprint + } parentElem["username_password_login"] = []interface{}{elem} case model.VerifiableAsymmetricLoginCredential__TYPE_IDENTIFIER: @@ -460,9 +475,17 @@ func setCredentialValuesInSchema(d *schema.ResourceData, credential *data.Struct return errs[0] } credEntry := entry.(model.VerifiableAsymmetricLoginCredential) - elem["asymmetric_credential"] = credEntry.AsymmetricCredential - elem["credential_key"] = credEntry.CredentialKey - elem["credential_verifier"] = credEntry.CredentialVerifier + // Normally NSX won't return sensitive info, in which case + // we need to keep values from intent to avoid permadiff + if credEntry.AsymmetricCredential != nil { + elem["asymmetric_credential"] = credEntry.AsymmetricCredential + } + if credEntry.CredentialKey != nil { + elem["credential_key"] = credEntry.CredentialKey + } + if credEntry.CredentialVerifier != nil { + elem["credential_verifier"] = credEntry.CredentialVerifier + } parentElem["verifiable_asymmetric_login"] = []interface{}{elem} default: diff --git a/nsxt/resource_nsxt_compute_manager_test.go b/nsxt/resource_nsxt_compute_manager_test.go index 7b4546de3..46db1e699 100644 --- a/nsxt/resource_nsxt_compute_manager_test.go +++ b/nsxt/resource_nsxt_compute_manager_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_relay_profile.go b/nsxt/resource_nsxt_dhcp_relay_profile.go index 519804f34..d78a62389 100644 --- a/nsxt/resource_nsxt_dhcp_relay_profile.go +++ b/nsxt/resource_nsxt_dhcp_relay_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_relay_profile_test.go b/nsxt/resource_nsxt_dhcp_relay_profile_test.go index c4a39fb70..824346275 100644 --- a/nsxt/resource_nsxt_dhcp_relay_profile_test.go +++ b/nsxt/resource_nsxt_dhcp_relay_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_relay_service.go b/nsxt/resource_nsxt_dhcp_relay_service.go index e4e804d30..6625de6ad 100644 --- a/nsxt/resource_nsxt_dhcp_relay_service.go +++ b/nsxt/resource_nsxt_dhcp_relay_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_relay_service_test.go b/nsxt/resource_nsxt_dhcp_relay_service_test.go index d7ec8d09e..eddbaf8ec 100644 --- a/nsxt/resource_nsxt_dhcp_relay_service_test.go +++ b/nsxt/resource_nsxt_dhcp_relay_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_server_ip_pool.go b/nsxt/resource_nsxt_dhcp_server_ip_pool.go index 77d75642b..fd8b1aa2b 100644 --- a/nsxt/resource_nsxt_dhcp_server_ip_pool.go +++ b/nsxt/resource_nsxt_dhcp_server_ip_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go b/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go index a4126591e..3961bb609 100644 --- a/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go +++ b/nsxt/resource_nsxt_dhcp_server_ip_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_server_profile.go b/nsxt/resource_nsxt_dhcp_server_profile.go index d0a45d92c..71381c5f2 100644 --- a/nsxt/resource_nsxt_dhcp_server_profile.go +++ b/nsxt/resource_nsxt_dhcp_server_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_dhcp_server_profile_test.go b/nsxt/resource_nsxt_dhcp_server_profile_test.go index e7bf95bc3..e8147bec4 100644 --- a/nsxt/resource_nsxt_dhcp_server_profile_test.go +++ b/nsxt/resource_nsxt_dhcp_server_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_edge_cluster.go b/nsxt/resource_nsxt_edge_cluster.go index dea2cb328..6643568f5 100644 --- a/nsxt/resource_nsxt_edge_cluster.go +++ b/nsxt/resource_nsxt_edge_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_edge_cluster_test.go b/nsxt/resource_nsxt_edge_cluster_test.go index 8d9140090..9a102f49e 100644 --- a/nsxt/resource_nsxt_edge_cluster_test.go +++ b/nsxt/resource_nsxt_edge_cluster_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_edge_high_availability_profile.go b/nsxt/resource_nsxt_edge_high_availability_profile.go index 03006f5cf..952b2abd5 100644 --- a/nsxt/resource_nsxt_edge_high_availability_profile.go +++ b/nsxt/resource_nsxt_edge_high_availability_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_edge_high_availability_profile_test.go b/nsxt/resource_nsxt_edge_high_availability_profile_test.go index 0a70d9ab8..68f94c472 100644 --- a/nsxt/resource_nsxt_edge_high_availability_profile_test.go +++ b/nsxt/resource_nsxt_edge_high_availability_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_edge_transport_node.go b/nsxt/resource_nsxt_edge_transport_node.go index 049332907..94a17b404 100644 --- a/nsxt/resource_nsxt_edge_transport_node.go +++ b/nsxt/resource_nsxt_edge_transport_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -27,8 +28,19 @@ import ( var ipAssignmentTypes = []string{ "assigned_by_dhcp", + "no_ipv4", "static_ip", "static_ip_pool", + "static_ip_mac", +} + +var ipv6AssignmentTypes = []string{ + "assigned_by_dhcpv6", + "assigned_by_autoconf", + "no_ipv6", + "static_ip", + "static_ip_pool", + "static_ip_mac", } var mpHostSwitchProfileTypeFromPolicyType = map[string]string{ @@ -435,7 +447,8 @@ func getStandardHostSwitchSchema(nodeType string) *schema.Schema { Computed: true, }, "host_switch_profile": getHostSwitchProfileIDsSchema(), - "ip_assignment": getIPAssignmentSchema(true), + "ip_assignment": getIPAssignmentSchema(false), + "ipv6_assignment": getIPv6AssignmentSchema(), "pnic": { Type: schema.TypeList, Optional: true, @@ -514,6 +527,7 @@ func getStandardHostSwitchSchema(nodeType string) *schema.Schema { }, "host_switch_profile": getHostSwitchProfileIDsSchema(), "ip_assignment": getIPAssignmentSchema(false), + "ipv6_assignment": getIPv6AssignmentSchema(), "uplink": getUplinksSchema(), }, }, @@ -617,6 +631,30 @@ func getHostSwitchProfileIDsSchema() *schema.Schema { } } +func getIpMacPairSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Description: "List of IP MAC pairs", + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ip_address": { + Type: schema.TypeString, + Description: "A single IPv6 address", + Required: true, + ValidateFunc: validation.IsIPv6Address, + }, + "mac_address": { + Type: schema.TypeString, + Description: "A single MAC address", + Required: true, + }, + }, + }, + Required: true, + } +} + func getIPAssignmentSchema(required bool) *schema.Schema { return &schema.Schema{ Type: schema.TypeList, @@ -669,6 +707,123 @@ func getIPAssignmentSchema(required bool) *schema.Schema { Optional: true, Description: "IP assignment specification for Static IP Pool", }, + "static_ip_mac": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "IP assignment specification for Static MAC List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "default_gateway": { + Type: schema.TypeString, + Required: true, + Description: "Gateway IP", + ValidateFunc: validateSingleIP(), + }, + "ip_mac_pair": getIpMacPairSchema(), + "subnet_mask": { + Type: schema.TypeString, + Required: true, + Description: "Subnet mask", + }, + }, + }, + }, + "no_ipv4": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "No IPv4 assignment", + }, + }, + }, + } +} + +func getIPv6AssignmentSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Description: "Specification for IPv6 to be used with host switch virtual tunnel endpoints", + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "assigned_by_dhcpv6": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enables DHCPv6 assignment", + }, + "assigned_by_autoconf": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Enables autoconf assignment", + }, + "no_ipv6": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "No IPv6 assignment", + }, + "static_ip": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "IP assignment specification for Static IP List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "default_gateway": { + Type: schema.TypeString, + Required: true, + Description: "Gateway IP", + ValidateFunc: validateSingleIP(), + }, + "ip_addresses": { + Type: schema.TypeList, + Description: "List of IPs for transport node host switch virtual tunnel endpoints", + MinItems: 1, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateSingleIP(), + }, + }, + "prefix_length": { + Type: schema.TypeString, + Required: true, + Description: "Prefix length", + }, + }, + }, + }, + "static_ip_mac": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Description: "IP assignment specification for Static MAC List.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "default_gateway": { + Type: schema.TypeString, + Required: true, + Description: "Gateway IP", + ValidateFunc: validateSingleIP(), + }, + "ip_mac_pair": getIpMacPairSchema(), + "prefix_length": { + Type: schema.TypeString, + Required: true, + Description: "Prefix length", + }, + }, + }, + }, + "static_ip_pool": { + Type: schema.TypeString, + Optional: true, + Description: "IP assignment specification for Static IP Pool", + }, }, }, } @@ -1016,7 +1171,7 @@ func getIPAssignmentFromSchema(ipAssignmentList interface{}) (*data.StructValue, converter := bindings.NewTypeConverter() for _, ia := range ipAssignmentList.([]interface{}) { - iaType, iaData, err := getIPAssignmentData(ia.(map[string]interface{})) + iaType, iaData, err := getIPAssignmentData(ia.(map[string]interface{}), ipAssignmentTypes) if err != nil { return nil, err } @@ -1034,6 +1189,16 @@ func getIPAssignmentFromSchema(ipAssignmentList interface{}) (*data.StructValue, } else { return nil, fmt.Errorf("no valid IP assignment found") } + case "no_ipv4": + nope := iaData.(bool) + if nope { + elem := mpmodel.NoIpv4{ + ResourceType: mpmodel.IpAssignmentSpec_RESOURCE_TYPE_NOIPV4, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.NoIpv4BindingType()) + } else { + return nil, fmt.Errorf("no valid IP assignment found") + } case "static_ip": for _, iad := range iaData.([]interface{}) { data := iad.(map[string]interface{}) @@ -1050,6 +1215,33 @@ func getIPAssignmentFromSchema(ipAssignmentList interface{}) (*data.StructValue, break } + case "static_ip_mac": + for _, iad := range iaData.([]interface{}) { + data := iad.(map[string]interface{}) + defaultGateway := data["default_gateway"].(string) + var ipMacList []mpmodel.IpMacPair + schemaList := data["ip_mac_pair"].([]interface{}) + for _, schemaEntry := range schemaList { + ipmac := schemaEntry.(map[string]interface{}) + ip := ipmac["ip_address"].(string) + mac := ipmac["mac_address"].(string) + entry := mpmodel.IpMacPair{ + Ip: &ip, + Mac: &mac, + } + ipMacList = append(ipMacList, entry) + } + subnetMask := data["subnet_mask"].(string) + elem := mpmodel.StaticIpMacListSpec{ + DefaultGateway: &defaultGateway, + IpMacList: ipMacList, + SubnetMask: &subnetMask, + ResourceType: mpmodel.IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.StaticIpMacListSpecBindingType()) + break + } + case "static_ip_pool": staticIPPoolID := iaData.(string) elem := mpmodel.StaticIpPoolSpec{ @@ -1070,6 +1262,114 @@ func getIPAssignmentFromSchema(ipAssignmentList interface{}) (*data.StructValue, return nil, nil } +func getIPv6AssignmentFromSchema(ipAssignmentList interface{}) (*data.StructValue, error) { + if ipAssignmentList == nil { + return nil, nil + } + converter := bindings.NewTypeConverter() + + for _, ia := range ipAssignmentList.([]interface{}) { + iaType, iaData, err := getIPAssignmentData(ia.(map[string]interface{}), ipv6AssignmentTypes) + if err != nil { + return nil, err + } + + var dataValue data.DataValue + var errs []error + switch iaType { + case "assigned_by_dhcpv6": + dhcpEnabled := iaData.(bool) + if dhcpEnabled { + elem := mpmodel.AssignedByDhcpv6{ + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCPV6, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.AssignedByDhcpv6BindingType()) + } else { + return nil, fmt.Errorf("no valid IP assignment found") + } + case "assigned_by_autoconf": + autoConf := iaData.(bool) + if autoConf { + elem := mpmodel.AssignedByAutoConf{ + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYAUTOCONF, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.AssignedByAutoConfBindingType()) + } else { + return nil, fmt.Errorf("no valid IP assignment found") + } + case "no_ipv6": + nope := iaData.(bool) + if nope { + elem := mpmodel.NoIpv6{ + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_NOIPV6, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.NoIpv6BindingType()) + } else { + return nil, fmt.Errorf("no valid IP assignment found") + } + case "static_ip": + for _, iad := range iaData.([]interface{}) { + data := iad.(map[string]interface{}) + defaultGateway := data["default_gateway"].(string) + ipList := interfaceListToStringList(data["ip_addresses"].([]interface{})) + prefixLength := data["prefix_length"].(string) + elem := mpmodel.StaticIpv6ListSpec{ + DefaultGateway: &defaultGateway, + Ipv6List: ipList, + PrefixLength: &prefixLength, + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6LISTSPEC, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.StaticIpv6ListSpecBindingType()) + break + } + + case "static_ip_mac": + for _, iad := range iaData.([]interface{}) { + data := iad.(map[string]interface{}) + defaultGateway := data["default_gateway"].(string) + var ipMacList []mpmodel.Ipv6MacPair + schemaList := data["ip_mac_pair"].([]interface{}) + for _, schemaEntry := range schemaList { + ipmac := schemaEntry.(map[string]interface{}) + ipv6 := ipmac["ip_address"].(string) + mac := ipmac["mac_address"].(string) + entry := mpmodel.Ipv6MacPair{ + Ipv6: &ipv6, + Mac: &mac, + } + ipMacList = append(ipMacList, entry) + } + prefixLength := data["prefix_length"].(string) + elem := mpmodel.StaticIpv6MacListSpec{ + DefaultGateway: &defaultGateway, + Ipv6MacList: ipMacList, + PrefixLength: &prefixLength, + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6MACLISTSPEC, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.StaticIpv6MacListSpecBindingType()) + break + } + + case "static_ip_pool": + staticIPPoolID := iaData.(string) + elem := mpmodel.StaticIpv6PoolSpec{ + Ipv6PoolId: &staticIPPoolID, + ResourceType: mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6POOLSPEC, + } + dataValue, errs = converter.ConvertToVapi(elem, mpmodel.StaticIpv6PoolSpecBindingType()) + + default: + return nil, fmt.Errorf("no valid IP assignment found") + } + if errs != nil { + return nil, errs[0] + } + entryStruct := dataValue.(*data.StructValue) + return entryStruct, nil + } + return nil, nil +} + func isSlice(v interface{}) bool { if v == nil { return false @@ -1091,12 +1391,12 @@ func isString(v interface{}) bool { return reflect.TypeOf(v).Kind() == reflect.String } -func getIPAssignmentData(data map[string]interface{}) (string, interface{}, error) { +func getIPAssignmentData(data map[string]interface{}, valueList []string) (string, interface{}, error) { var t string var d interface{} n := 0 - for _, iaType := range ipAssignmentTypes { + for _, iaType := range valueList { d1 := data[iaType] if (isString(d1) && d1 != "") || (isSlice(d1) && len(d1.([]interface{})) > 0) || (isBool(d1) && d1.(bool)) { t, d = iaType, data[iaType] @@ -1143,6 +1443,10 @@ func getHostSwitchSpecFromSchema(d *schema.ResourceData, m interface{}, nodeType if err != nil { return nil, fmt.Errorf("error parsing HostSwitchSpec schema %v", err) } + iPv6AssignmentSpec, err := getIPv6AssignmentFromSchema(swData["ipv6_assignment"]) + if err != nil { + return nil, fmt.Errorf("error parsing HostSwitchSpec schema %v", err) + } var pNics []mpmodel.Pnic for _, p := range swData["pnic"].([]interface{}) { data := p.(map[string]interface{}) @@ -1169,6 +1473,7 @@ func getHostSwitchSpecFromSchema(d *schema.ResourceData, m interface{}, nodeType HostSwitchProfileIds: hostSwitchProfileIDs, HostSwitchType: &hostSwitchType, IpAssignmentSpec: iPAssignmentSpec, + Ipv6AssignmentSpec: iPv6AssignmentSpec, Pnics: pNics, TransportZoneEndpoints: transportZoneEndpoints, } @@ -1461,11 +1766,6 @@ func setHostSwitchSpecInSchema(d *schema.ResourceData, spec *data.StructValue, n swEntry := entry.(mpmodel.StandardHostSwitchSpec) for _, sw := range swEntry.HostSwitches { - // TODO - remove this when SDK is updated with NSX 4.1.2 - if sw.IpAssignmentSpec == nil { - return fmt.Errorf("Ipv6 assignments are not supported yet") - } - elem := make(map[string]interface{}) elem["host_switch_id"] = sw.HostSwitchId elem["host_switch_name"] = sw.HostSwitchName @@ -1474,7 +1774,15 @@ func setHostSwitchSpecInSchema(d *schema.ResourceData, spec *data.StructValue, n elem["host_switch_profile"] = profiles } var err error - elem["ip_assignment"], err = setIPAssignmentInSchema(sw.IpAssignmentSpec) + if sw.IpAssignmentSpec != nil { + elem["ip_assignment"], err = setIPAssignmentInSchema(sw.IpAssignmentSpec) + } + if err != nil { + return err + } + if sw.Ipv6AssignmentSpec != nil { + elem["ipv6_assignment"], err = setIPv6AssignmentInSchema(sw.Ipv6AssignmentSpec) + } if err != nil { return err } @@ -1513,6 +1821,12 @@ func setHostSwitchSpecInSchema(d *schema.ResourceData, spec *data.StructValue, n return err } } + if tnpsc.HostSwitchConfigOption.IpAssignmentSpec != nil { + hsCfgOpt["ipv6_assignment"], err = setIPv6AssignmentInSchema(tnpsc.HostSwitchConfigOption.Ipv6AssignmentSpec) + if err != nil { + return err + } + } hsCfgOpt["uplink"] = setUplinksFromSchema(tnpsc.HostSwitchConfigOption.Uplinks) e["host_switch_config_option"] = []interface{}{hsCfgOpt} e["name"] = tnpsc.Name @@ -1582,6 +1896,9 @@ func setIPAssignmentInSchema(spec *data.StructValue) (interface{}, error) { case mpmodel.IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP: elem["assigned_by_dhcp"] = true + case mpmodel.IpAssignmentSpec_RESOURCE_TYPE_NOIPV4: + elem["no_ipv4"] = true + case mpmodel.IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC: e := make(map[string]interface{}) entry, errs := converter.ConvertToGolang(spec, mpmodel.StaticIpListSpecBindingType()) @@ -1601,7 +1918,92 @@ func setIPAssignmentInSchema(spec *data.StructValue) (interface{}, error) { } ipAsEntry := entry.(mpmodel.StaticIpPoolSpec) elem["static_ip_pool"] = ipAsEntry.IpPoolId + + case mpmodel.IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC: + e := make(map[string]interface{}) + entry, errs := converter.ConvertToGolang(spec, mpmodel.StaticIpMacListSpecBindingType()) + if errs != nil { + return nil, errs[0] + } + ipAsEntry := entry.(mpmodel.StaticIpMacListSpec) + e["default_gateway"] = ipAsEntry.DefaultGateway + e["subnet_mask"] = ipAsEntry.SubnetMask + + var ipMacPairList []map[string]interface{} + for _, elem := range ipAsEntry.IpMacList { + pair := make(map[string]interface{}) + pair["ip_address"] = elem.Ip + pair["mac_address"] = elem.Mac + ipMacPairList = append(ipMacPairList, pair) + } + e["ip_mac_pair"] = ipMacPairList + elem["static_ip_mac"] = []map[string]interface{}{e} } + + return []interface{}{elem}, nil +} + +func setIPv6AssignmentInSchema(spec *data.StructValue) (interface{}, error) { + elem := make(map[string]interface{}) + + converter := bindings.NewTypeConverter() + base, errs := converter.ConvertToGolang(spec, mpmodel.Ipv6AssignmentSpecBindingType()) + if errs != nil { + return nil, errs[0] + } + assignmentType := base.(mpmodel.Ipv6AssignmentSpec).ResourceType + + switch assignmentType { + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCPV6: + elem["assigned_by_dhcpv6"] = true + + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYAUTOCONF: + elem["assigned_by_autoconf"] = true + + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_NOIPV6: + elem["no_ipv6"] = true + + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6LISTSPEC: + e := make(map[string]interface{}) + entry, errs := converter.ConvertToGolang(spec, mpmodel.StaticIpv6ListSpecBindingType()) + if errs != nil { + return nil, errs[0] + } + ipAsEntry := entry.(mpmodel.StaticIpv6ListSpec) + e["default_gateway"] = ipAsEntry.DefaultGateway + e["ip_addresses"] = ipAsEntry.Ipv6List + e["prefix_length"] = ipAsEntry.PrefixLength + elem["static_ip"] = []map[string]interface{}{e} + + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6POOLSPEC: + entry, errs := converter.ConvertToGolang(spec, mpmodel.StaticIpv6PoolSpecBindingType()) + if errs != nil { + return nil, errs[0] + } + ipAsEntry := entry.(mpmodel.StaticIpv6PoolSpec) + elem["static_ip_pool"] = ipAsEntry.Ipv6PoolId + + case mpmodel.Ipv6AssignmentSpec_RESOURCE_TYPE_STATICIPV6MACLISTSPEC: + e := make(map[string]interface{}) + entry, errs := converter.ConvertToGolang(spec, mpmodel.StaticIpv6MacListSpecBindingType()) + if errs != nil { + return nil, errs[0] + } + ipAsEntry := entry.(mpmodel.StaticIpv6MacListSpec) + e["default_gateway"] = ipAsEntry.DefaultGateway + e["prefix_length"] = ipAsEntry.PrefixLength + + var ipMacPairList []map[string]interface{} + for _, elem := range ipAsEntry.Ipv6MacList { + pair := make(map[string]interface{}) + pair["ip_address"] = elem.Ipv6 + pair["mac_address"] = elem.Mac + ipMacPairList = append(ipMacPairList, pair) + } + e["ip_mac_pair"] = ipMacPairList + elem["static_ip_mac"] = []map[string]interface{}{e} + } + return []interface{}{elem}, nil } diff --git a/nsxt/resource_nsxt_edge_transport_node_rtep.go b/nsxt/resource_nsxt_edge_transport_node_rtep.go index f246f112c..7fa448311 100644 --- a/nsxt/resource_nsxt_edge_transport_node_rtep.go +++ b/nsxt/resource_nsxt_edge_transport_node_rtep.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ether_type_ns_service.go b/nsxt/resource_nsxt_ether_type_ns_service.go index 508ab2892..b0649002c 100644 --- a/nsxt/resource_nsxt_ether_type_ns_service.go +++ b/nsxt/resource_nsxt_ether_type_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ether_type_ns_service_test.go b/nsxt/resource_nsxt_ether_type_ns_service_test.go index 849af2d42..e4014ba25 100644 --- a/nsxt/resource_nsxt_ether_type_ns_service_test.go +++ b/nsxt/resource_nsxt_ether_type_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_failure_domain.go b/nsxt/resource_nsxt_failure_domain.go index fcadae5da..d47f26279 100644 --- a/nsxt/resource_nsxt_failure_domain.go +++ b/nsxt/resource_nsxt_failure_domain.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_failure_domain_test.go b/nsxt/resource_nsxt_failure_domain_test.go index 37ce8d9e0..d7f7f9be1 100644 --- a/nsxt/resource_nsxt_failure_domain_test.go +++ b/nsxt/resource_nsxt_failure_domain_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_firewall_section.go b/nsxt/resource_nsxt_firewall_section.go index fcff4013f..bbf9214ab 100644 --- a/nsxt/resource_nsxt_firewall_section.go +++ b/nsxt/resource_nsxt_firewall_section.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_firewall_section_test.go b/nsxt/resource_nsxt_firewall_section_test.go index befc110e6..5ab45edde 100644 --- a/nsxt/resource_nsxt_firewall_section_test.go +++ b/nsxt/resource_nsxt_firewall_section_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_icmp_type_ns_service.go b/nsxt/resource_nsxt_icmp_type_ns_service.go index 47640ece6..56541d15e 100644 --- a/nsxt/resource_nsxt_icmp_type_ns_service.go +++ b/nsxt/resource_nsxt_icmp_type_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_icmp_type_ns_service_test.go b/nsxt/resource_nsxt_icmp_type_ns_service_test.go index 39f8e2ffc..02b4a4ef0 100644 --- a/nsxt/resource_nsxt_icmp_type_ns_service_test.go +++ b/nsxt/resource_nsxt_icmp_type_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_igmp_type_ns_service.go b/nsxt/resource_nsxt_igmp_type_ns_service.go index c333353fc..4ff91d12a 100644 --- a/nsxt/resource_nsxt_igmp_type_ns_service.go +++ b/nsxt/resource_nsxt_igmp_type_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_igmp_type_ns_service_test.go b/nsxt/resource_nsxt_igmp_type_ns_service_test.go index e4283b9cb..3f8b63462 100644 --- a/nsxt/resource_nsxt_igmp_type_ns_service_test.go +++ b/nsxt/resource_nsxt_igmp_type_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_block.go b/nsxt/resource_nsxt_ip_block.go index 7d4908e1d..148f999a4 100644 --- a/nsxt/resource_nsxt_ip_block.go +++ b/nsxt/resource_nsxt_ip_block.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_block_subnet.go b/nsxt/resource_nsxt_ip_block_subnet.go index 7f7b09740..c04dcb138 100644 --- a/nsxt/resource_nsxt_ip_block_subnet.go +++ b/nsxt/resource_nsxt_ip_block_subnet.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_block_subnet_test.go b/nsxt/resource_nsxt_ip_block_subnet_test.go index 94b46675d..bef02bd81 100644 --- a/nsxt/resource_nsxt_ip_block_subnet_test.go +++ b/nsxt/resource_nsxt_ip_block_subnet_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_block_test.go b/nsxt/resource_nsxt_ip_block_test.go index a89ba5c56..c9c6d79d1 100644 --- a/nsxt/resource_nsxt_ip_block_test.go +++ b/nsxt/resource_nsxt_ip_block_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_discovery_switching_profile.go b/nsxt/resource_nsxt_ip_discovery_switching_profile.go index 9fe0b390e..f04f78ca3 100644 --- a/nsxt/resource_nsxt_ip_discovery_switching_profile.go +++ b/nsxt/resource_nsxt_ip_discovery_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go b/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go index 94e358bfe..6b3861864 100644 --- a/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go +++ b/nsxt/resource_nsxt_ip_discovery_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_pool.go b/nsxt/resource_nsxt_ip_pool.go index 4907bbe19..23ced3c64 100644 --- a/nsxt/resource_nsxt_ip_pool.go +++ b/nsxt/resource_nsxt_ip_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_pool_allocation_ip_address.go b/nsxt/resource_nsxt_ip_pool_allocation_ip_address.go index 9f209ce0a..c683cb20c 100644 --- a/nsxt/resource_nsxt_ip_pool_allocation_ip_address.go +++ b/nsxt/resource_nsxt_ip_pool_allocation_ip_address.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go b/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go index 64cccf43a..256ab77e6 100644 --- a/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go +++ b/nsxt/resource_nsxt_ip_pool_allocation_ip_address_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_pool_test.go b/nsxt/resource_nsxt_ip_pool_test.go index 3accaaf5e..ecac52df7 100644 --- a/nsxt/resource_nsxt_ip_pool_test.go +++ b/nsxt/resource_nsxt_ip_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_protocol_ns_service.go b/nsxt/resource_nsxt_ip_protocol_ns_service.go index 4bd353620..ec1688655 100644 --- a/nsxt/resource_nsxt_ip_protocol_ns_service.go +++ b/nsxt/resource_nsxt_ip_protocol_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_protocol_ns_service_test.go b/nsxt/resource_nsxt_ip_protocol_ns_service_test.go index 2f9491f38..35ebd5118 100644 --- a/nsxt/resource_nsxt_ip_protocol_ns_service_test.go +++ b/nsxt/resource_nsxt_ip_protocol_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_set.go b/nsxt/resource_nsxt_ip_set.go index 409af40c2..e0f766bcd 100644 --- a/nsxt/resource_nsxt_ip_set.go +++ b/nsxt/resource_nsxt_ip_set.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ip_set_test.go b/nsxt/resource_nsxt_ip_set_test.go index 2f1e18543..fa8039ce1 100644 --- a/nsxt/resource_nsxt_ip_set_test.go +++ b/nsxt/resource_nsxt_ip_set_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_l4_port_set_ns_service.go b/nsxt/resource_nsxt_l4_port_set_ns_service.go index ed439f2a4..dac5497cb 100644 --- a/nsxt/resource_nsxt_l4_port_set_ns_service.go +++ b/nsxt/resource_nsxt_l4_port_set_ns_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_l4_port_set_ns_service_test.go b/nsxt/resource_nsxt_l4_port_set_ns_service_test.go index 59c1b2094..d4753b784 100644 --- a/nsxt/resource_nsxt_l4_port_set_ns_service_test.go +++ b/nsxt/resource_nsxt_l4_port_set_ns_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_client_ssl_profile.go b/nsxt/resource_nsxt_lb_client_ssl_profile.go index 87e62521d..cc29b516d 100644 --- a/nsxt/resource_nsxt_lb_client_ssl_profile.go +++ b/nsxt/resource_nsxt_lb_client_ssl_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_client_ssl_profile_test.go b/nsxt/resource_nsxt_lb_client_ssl_profile_test.go index e23b1e7b6..314f059bc 100644 --- a/nsxt/resource_nsxt_lb_client_ssl_profile_test.go +++ b/nsxt/resource_nsxt_lb_client_ssl_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_cookie_persistence_profile.go b/nsxt/resource_nsxt_lb_cookie_persistence_profile.go index 6cdae8417..e6124a6a4 100644 --- a/nsxt/resource_nsxt_lb_cookie_persistence_profile.go +++ b/nsxt/resource_nsxt_lb_cookie_persistence_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go b/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go index bca0b114b..85d2f971b 100644 --- a/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go +++ b/nsxt/resource_nsxt_lb_cookie_persistence_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_fast_tcp_application_profile.go b/nsxt/resource_nsxt_lb_fast_tcp_application_profile.go index f797c1a21..d3799321b 100644 --- a/nsxt/resource_nsxt_lb_fast_tcp_application_profile.go +++ b/nsxt/resource_nsxt_lb_fast_tcp_application_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go b/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go index e79d39205..b1ab89bed 100644 --- a/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_fast_tcp_application_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_fast_udp_application_profile.go b/nsxt/resource_nsxt_lb_fast_udp_application_profile.go index f41a99de8..75b541aff 100644 --- a/nsxt/resource_nsxt_lb_fast_udp_application_profile.go +++ b/nsxt/resource_nsxt_lb_fast_udp_application_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go b/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go index f7e1afb63..4613ad898 100644 --- a/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_fast_udp_application_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_application_profile.go b/nsxt/resource_nsxt_lb_http_application_profile.go index 115f8c210..e7a57490e 100644 --- a/nsxt/resource_nsxt_lb_http_application_profile.go +++ b/nsxt/resource_nsxt_lb_http_application_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_application_profile_test.go b/nsxt/resource_nsxt_lb_http_application_profile_test.go index 2428f9463..0dd13977c 100644 --- a/nsxt/resource_nsxt_lb_http_application_profile_test.go +++ b/nsxt/resource_nsxt_lb_http_application_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_forwarding_rule.go b/nsxt/resource_nsxt_lb_http_forwarding_rule.go index 7b16a2962..76d637939 100644 --- a/nsxt/resource_nsxt_lb_http_forwarding_rule.go +++ b/nsxt/resource_nsxt_lb_http_forwarding_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go b/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go index 4916f8d08..76e49419d 100644 --- a/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_forwarding_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_monitor.go b/nsxt/resource_nsxt_lb_http_monitor.go index 6f1e625bf..e1201bde4 100644 --- a/nsxt/resource_nsxt_lb_http_monitor.go +++ b/nsxt/resource_nsxt_lb_http_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_request_rewrite_rule.go b/nsxt/resource_nsxt_lb_http_request_rewrite_rule.go index 6b65f1368..8e784e6b2 100644 --- a/nsxt/resource_nsxt_lb_http_request_rewrite_rule.go +++ b/nsxt/resource_nsxt_lb_http_request_rewrite_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go b/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go index a7ae767c2..eb778e139 100644 --- a/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_request_rewrite_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_response_rewrite_rule.go b/nsxt/resource_nsxt_lb_http_response_rewrite_rule.go index ba328dfa5..ebac014cf 100644 --- a/nsxt/resource_nsxt_lb_http_response_rewrite_rule.go +++ b/nsxt/resource_nsxt_lb_http_response_rewrite_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go b/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go index dc71b3ed4..52ab726c8 100644 --- a/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go +++ b/nsxt/resource_nsxt_lb_http_response_rewrite_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_virtual_server.go b/nsxt/resource_nsxt_lb_http_virtual_server.go index ccb27e980..008335ca6 100644 --- a/nsxt/resource_nsxt_lb_http_virtual_server.go +++ b/nsxt/resource_nsxt_lb_http_virtual_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_http_virtual_server_test.go b/nsxt/resource_nsxt_lb_http_virtual_server_test.go index a994ec7f3..ba3add6ea 100644 --- a/nsxt/resource_nsxt_lb_http_virtual_server_test.go +++ b/nsxt/resource_nsxt_lb_http_virtual_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_https_monitor.go b/nsxt/resource_nsxt_lb_https_monitor.go index a85fd7c12..867b0b620 100644 --- a/nsxt/resource_nsxt_lb_https_monitor.go +++ b/nsxt/resource_nsxt_lb_https_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_icmp_monitor.go b/nsxt/resource_nsxt_lb_icmp_monitor.go index 1f9d923f7..5563188d6 100644 --- a/nsxt/resource_nsxt_lb_icmp_monitor.go +++ b/nsxt/resource_nsxt_lb_icmp_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_icmp_monitor_test.go b/nsxt/resource_nsxt_lb_icmp_monitor_test.go index 9bf1fdd31..4ddd856e1 100644 --- a/nsxt/resource_nsxt_lb_icmp_monitor_test.go +++ b/nsxt/resource_nsxt_lb_icmp_monitor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_l4_monitor_test.go b/nsxt/resource_nsxt_lb_l4_monitor_test.go index edb15f3fb..b04c5724d 100644 --- a/nsxt/resource_nsxt_lb_l4_monitor_test.go +++ b/nsxt/resource_nsxt_lb_l4_monitor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_l4_virtual_server_test.go b/nsxt/resource_nsxt_lb_l4_virtual_server_test.go index 65c47df83..9a236467e 100644 --- a/nsxt/resource_nsxt_lb_l4_virtual_server_test.go +++ b/nsxt/resource_nsxt_lb_l4_virtual_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_l7_monitor_test.go b/nsxt/resource_nsxt_lb_l7_monitor_test.go index 7e29d5915..5ea8da11f 100644 --- a/nsxt/resource_nsxt_lb_l7_monitor_test.go +++ b/nsxt/resource_nsxt_lb_l7_monitor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_passive_monitor.go b/nsxt/resource_nsxt_lb_passive_monitor.go index 0b8bf1b14..b5b4cac13 100644 --- a/nsxt/resource_nsxt_lb_passive_monitor.go +++ b/nsxt/resource_nsxt_lb_passive_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_passive_monitor_test.go b/nsxt/resource_nsxt_lb_passive_monitor_test.go index 9c3901a4e..9b66dadfe 100644 --- a/nsxt/resource_nsxt_lb_passive_monitor_test.go +++ b/nsxt/resource_nsxt_lb_passive_monitor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_pool.go b/nsxt/resource_nsxt_lb_pool.go index 93ce0ff39..5346e1b3e 100644 --- a/nsxt/resource_nsxt_lb_pool.go +++ b/nsxt/resource_nsxt_lb_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_pool_test.go b/nsxt/resource_nsxt_lb_pool_test.go index a6a71bd9f..6d2ac1852 100644 --- a/nsxt/resource_nsxt_lb_pool_test.go +++ b/nsxt/resource_nsxt_lb_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_server_ssl_profile.go b/nsxt/resource_nsxt_lb_server_ssl_profile.go index 94ff2b3b9..5658910f3 100644 --- a/nsxt/resource_nsxt_lb_server_ssl_profile.go +++ b/nsxt/resource_nsxt_lb_server_ssl_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_server_ssl_profile_test.go b/nsxt/resource_nsxt_lb_server_ssl_profile_test.go index a56136c54..2d658900e 100644 --- a/nsxt/resource_nsxt_lb_server_ssl_profile_test.go +++ b/nsxt/resource_nsxt_lb_server_ssl_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_service.go b/nsxt/resource_nsxt_lb_service.go index 9dc0098c8..df748ee70 100644 --- a/nsxt/resource_nsxt_lb_service.go +++ b/nsxt/resource_nsxt_lb_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_service_test.go b/nsxt/resource_nsxt_lb_service_test.go index a48425d58..b642e1fd6 100644 --- a/nsxt/resource_nsxt_lb_service_test.go +++ b/nsxt/resource_nsxt_lb_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_source_ip_persistence_profile.go b/nsxt/resource_nsxt_lb_source_ip_persistence_profile.go index 090f47bcc..428541cc0 100644 --- a/nsxt/resource_nsxt_lb_source_ip_persistence_profile.go +++ b/nsxt/resource_nsxt_lb_source_ip_persistence_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go b/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go index c62a68543..788bdc730 100644 --- a/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go +++ b/nsxt/resource_nsxt_lb_source_ip_persistence_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_tcp_monitor.go b/nsxt/resource_nsxt_lb_tcp_monitor.go index a45ce15f6..0a8f35b4e 100644 --- a/nsxt/resource_nsxt_lb_tcp_monitor.go +++ b/nsxt/resource_nsxt_lb_tcp_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_tcp_virtual_server.go b/nsxt/resource_nsxt_lb_tcp_virtual_server.go index a5c8d6423..66709c341 100644 --- a/nsxt/resource_nsxt_lb_tcp_virtual_server.go +++ b/nsxt/resource_nsxt_lb_tcp_virtual_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_udp_monitor.go b/nsxt/resource_nsxt_lb_udp_monitor.go index 4496e96c7..fab899ec6 100644 --- a/nsxt/resource_nsxt_lb_udp_monitor.go +++ b/nsxt/resource_nsxt_lb_udp_monitor.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_lb_udp_virtual_server.go b/nsxt/resource_nsxt_lb_udp_virtual_server.go index 16967b518..948a4ab26 100644 --- a/nsxt/resource_nsxt_lb_udp_virtual_server.go +++ b/nsxt/resource_nsxt_lb_udp_virtual_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_dhcp_port.go b/nsxt/resource_nsxt_logical_dhcp_port.go index 1c48754d4..97b2ec3f7 100644 --- a/nsxt/resource_nsxt_logical_dhcp_port.go +++ b/nsxt/resource_nsxt_logical_dhcp_port.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_dhcp_port_test.go b/nsxt/resource_nsxt_logical_dhcp_port_test.go index 37489c8e9..c75d239f2 100644 --- a/nsxt/resource_nsxt_logical_dhcp_port_test.go +++ b/nsxt/resource_nsxt_logical_dhcp_port_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_dhcp_server.go b/nsxt/resource_nsxt_logical_dhcp_server.go index 24082ed88..d38ce04d2 100644 --- a/nsxt/resource_nsxt_logical_dhcp_server.go +++ b/nsxt/resource_nsxt_logical_dhcp_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_dhcp_server_test.go b/nsxt/resource_nsxt_logical_dhcp_server_test.go index 7269fb5a3..7033d3e85 100644 --- a/nsxt/resource_nsxt_logical_dhcp_server_test.go +++ b/nsxt/resource_nsxt_logical_dhcp_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_port.go b/nsxt/resource_nsxt_logical_port.go index e97a6147b..45a45797a 100644 --- a/nsxt/resource_nsxt_logical_port.go +++ b/nsxt/resource_nsxt_logical_port.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_port_test.go b/nsxt/resource_nsxt_logical_port_test.go index 77b729f07..8acbda076 100644 --- a/nsxt/resource_nsxt_logical_port_test.go +++ b/nsxt/resource_nsxt_logical_port_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_centralized_service_port.go b/nsxt/resource_nsxt_logical_router_centralized_service_port.go index 68878062c..1f38e8398 100644 --- a/nsxt/resource_nsxt_logical_router_centralized_service_port.go +++ b/nsxt/resource_nsxt_logical_router_centralized_service_port.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go b/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go index f0abfaabe..83ef62f3c 100644 --- a/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go +++ b/nsxt/resource_nsxt_logical_router_centralized_service_port_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_downlink_port.go b/nsxt/resource_nsxt_logical_router_downlink_port.go index 64071296f..03a41770a 100644 --- a/nsxt/resource_nsxt_logical_router_downlink_port.go +++ b/nsxt/resource_nsxt_logical_router_downlink_port.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_downlink_port_test.go b/nsxt/resource_nsxt_logical_router_downlink_port_test.go index 3d4aa5610..b6f5c2e50 100644 --- a/nsxt/resource_nsxt_logical_router_downlink_port_test.go +++ b/nsxt/resource_nsxt_logical_router_downlink_port_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier0.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier0.go index 7e1e98041..e4a7a3a08 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier0.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier0.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go index 8ba5c8434..cfa02afae 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier0_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier1.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier1.go index 9fdb5a217..ec818eff6 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier1.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier1.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go b/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go index 053bc63c1..c8bcaaa2f 100644 --- a/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go +++ b/nsxt/resource_nsxt_logical_router_link_port_on_tier1_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_switch.go b/nsxt/resource_nsxt_logical_switch.go index 240052123..758569366 100644 --- a/nsxt/resource_nsxt_logical_switch.go +++ b/nsxt/resource_nsxt_logical_switch.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_switch_test.go b/nsxt/resource_nsxt_logical_switch_test.go index 8b2bfe97a..454b83d52 100644 --- a/nsxt/resource_nsxt_logical_switch_test.go +++ b/nsxt/resource_nsxt_logical_switch_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_tier0_router.go b/nsxt/resource_nsxt_logical_tier0_router.go index 3331549a3..adcdc1a47 100644 --- a/nsxt/resource_nsxt_logical_tier0_router.go +++ b/nsxt/resource_nsxt_logical_tier0_router.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_tier0_router_test.go b/nsxt/resource_nsxt_logical_tier0_router_test.go index b1c9e21e6..d6093b611 100644 --- a/nsxt/resource_nsxt_logical_tier0_router_test.go +++ b/nsxt/resource_nsxt_logical_tier0_router_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_tier1_router.go b/nsxt/resource_nsxt_logical_tier1_router.go index e8b928fa6..24f88ab27 100644 --- a/nsxt/resource_nsxt_logical_tier1_router.go +++ b/nsxt/resource_nsxt_logical_tier1_router.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_logical_tier1_router_test.go b/nsxt/resource_nsxt_logical_tier1_router_test.go index b99bb2901..08cf6afb0 100644 --- a/nsxt/resource_nsxt_logical_tier1_router_test.go +++ b/nsxt/resource_nsxt_logical_tier1_router_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_mac_management_switching_profile.go b/nsxt/resource_nsxt_mac_management_switching_profile.go index 511d7224c..90f2613bc 100644 --- a/nsxt/resource_nsxt_mac_management_switching_profile.go +++ b/nsxt/resource_nsxt_mac_management_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_mac_management_switching_profile_test.go b/nsxt/resource_nsxt_mac_management_switching_profile_test.go index 37c3356da..0031921de 100644 --- a/nsxt/resource_nsxt_mac_management_switching_profile_test.go +++ b/nsxt/resource_nsxt_mac_management_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_manager_cluster.go b/nsxt/resource_nsxt_manager_cluster.go index cc89b07b5..d6baf94b8 100644 --- a/nsxt/resource_nsxt_manager_cluster.go +++ b/nsxt/resource_nsxt_manager_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_nat_rule.go b/nsxt/resource_nsxt_nat_rule.go index 967a7adf2..e5567eae8 100644 --- a/nsxt/resource_nsxt_nat_rule.go +++ b/nsxt/resource_nsxt_nat_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_nat_rule_test.go b/nsxt/resource_nsxt_nat_rule_test.go index af99e1828..745d5071d 100644 --- a/nsxt/resource_nsxt_nat_rule_test.go +++ b/nsxt/resource_nsxt_nat_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_node_user.go b/nsxt/resource_nsxt_node_user.go index b1368536a..f0dc96c27 100644 --- a/nsxt/resource_nsxt_node_user.go +++ b/nsxt/resource_nsxt_node_user.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_node_user_test.go b/nsxt/resource_nsxt_node_user_test.go index beb7dda4c..705239b41 100644 --- a/nsxt/resource_nsxt_node_user_test.go +++ b/nsxt/resource_nsxt_node_user_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ns_group.go b/nsxt/resource_nsxt_ns_group.go index 215c75f0f..4323d3a37 100644 --- a/nsxt/resource_nsxt_ns_group.go +++ b/nsxt/resource_nsxt_ns_group.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/resource_nsxt_ns_group_test.go b/nsxt/resource_nsxt_ns_group_test.go index 6d8669f41..b90bfa8b5 100644 --- a/nsxt/resource_nsxt_ns_group_test.go +++ b/nsxt/resource_nsxt_ns_group_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ns_service_group.go b/nsxt/resource_nsxt_ns_service_group.go index b6b27a10b..038587ac3 100644 --- a/nsxt/resource_nsxt_ns_service_group.go +++ b/nsxt/resource_nsxt_ns_service_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_ns_service_group_test.go b/nsxt/resource_nsxt_ns_service_group_test.go index 16d9a8a9d..fc0662514 100644 --- a/nsxt/resource_nsxt_ns_service_group_test.go +++ b/nsxt/resource_nsxt_ns_service_group_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_bgp_config.go b/nsxt/resource_nsxt_policy_bgp_config.go index 6863819de..c4dcefd4a 100644 --- a/nsxt/resource_nsxt_policy_bgp_config.go +++ b/nsxt/resource_nsxt_policy_bgp_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_bgp_config_test.go b/nsxt/resource_nsxt_policy_bgp_config_test.go index 0bfacb25d..4ab582838 100644 --- a/nsxt/resource_nsxt_policy_bgp_config_test.go +++ b/nsxt/resource_nsxt_policy_bgp_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_bgp_neighbor.go b/nsxt/resource_nsxt_policy_bgp_neighbor.go index c78eec74e..1d20cff45 100644 --- a/nsxt/resource_nsxt_policy_bgp_neighbor.go +++ b/nsxt/resource_nsxt_policy_bgp_neighbor.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_bgp_neighbor_test.go b/nsxt/resource_nsxt_policy_bgp_neighbor_test.go index 0b3d4900c..a26f502d9 100644 --- a/nsxt/resource_nsxt_policy_bgp_neighbor_test.go +++ b/nsxt/resource_nsxt_policy_bgp_neighbor_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_compute_sub_cluster.go b/nsxt/resource_nsxt_policy_compute_sub_cluster.go index d77f6000a..7ba96a24a 100644 --- a/nsxt/resource_nsxt_policy_compute_sub_cluster.go +++ b/nsxt/resource_nsxt_policy_compute_sub_cluster.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_context_profile.go b/nsxt/resource_nsxt_policy_context_profile.go index b9238657e..67ec46c3c 100644 --- a/nsxt/resource_nsxt_policy_context_profile.go +++ b/nsxt/resource_nsxt_policy_context_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -44,6 +45,8 @@ var subAttributeReverseKeyMap = map[string]string{ model.PolicySubAttributes_KEY_CIFS_SMB_VERSION: "cifs_smb_version", } +var contextProfilePathExample = getMultitenancyPathExample("/infra/context-profiles/[profile]") + func resourceNsxtPolicyContextProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyContextProfileCreate, @@ -51,7 +54,7 @@ func resourceNsxtPolicyContextProfile() *schema.Resource { Update: resourceNsxtPolicyContextProfileUpdate, Delete: resourceNsxtPolicyContextProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(contextProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_context_profile_custom_attribute.go b/nsxt/resource_nsxt_policy_context_profile_custom_attribute.go index d32ea1de6..eac5f012f 100644 --- a/nsxt/resource_nsxt_policy_context_profile_custom_attribute.go +++ b/nsxt/resource_nsxt_policy_context_profile_custom_attribute.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_context_profile_custom_attribute_test.go b/nsxt/resource_nsxt_policy_context_profile_custom_attribute_test.go index b4423d39b..9357e4e6d 100644 --- a/nsxt/resource_nsxt_policy_context_profile_custom_attribute_test.go +++ b/nsxt/resource_nsxt_policy_context_profile_custom_attribute_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_context_profile_test.go b/nsxt/resource_nsxt_policy_context_profile_test.go index af55f1bbd..2b8294091 100644 --- a/nsxt/resource_nsxt_policy_context_profile_test.go +++ b/nsxt/resource_nsxt_policy_context_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_relay.go b/nsxt/resource_nsxt_policy_dhcp_relay.go index e0b6064bb..7b596471a 100644 --- a/nsxt/resource_nsxt_policy_dhcp_relay.go +++ b/nsxt/resource_nsxt_policy_dhcp_relay.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var dhcpRelayPathExample = getMultitenancyPathExample("/infra/dhcp-relays/[dhcp-relay]") + func resourceNsxtPolicyDhcpRelayConfig() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyDhcpRelayConfigCreate, @@ -22,7 +25,7 @@ func resourceNsxtPolicyDhcpRelayConfig() *schema.Resource { Update: resourceNsxtPolicyDhcpRelayConfigUpdate, Delete: resourceNsxtPolicyDhcpRelayConfigDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(dhcpRelayPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_dhcp_relay_test.go b/nsxt/resource_nsxt_policy_dhcp_relay_test.go index dd97b2f43..f0cbf3009 100644 --- a/nsxt/resource_nsxt_policy_dhcp_relay_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_relay_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_server.go b/nsxt/resource_nsxt_policy_dhcp_server.go index e24278b99..05a6aa99a 100644 --- a/nsxt/resource_nsxt_policy_dhcp_server.go +++ b/nsxt/resource_nsxt_policy_dhcp_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -16,6 +17,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var dhcpServerPathExample = getMultitenancyPathExample("/infra/dhcp-servers/[dhcp-server]") + func resourceNsxtPolicyDhcpServer() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyDhcpServerCreate, @@ -23,7 +26,7 @@ func resourceNsxtPolicyDhcpServer() *schema.Resource { Update: resourceNsxtPolicyDhcpServerUpdate, Delete: resourceNsxtPolicyDhcpServerDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(dhcpServerPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_dhcp_server_test.go b/nsxt/resource_nsxt_policy_dhcp_server_test.go index 734a5b89e..4d8cdf2ed 100644 --- a/nsxt/resource_nsxt_policy_dhcp_server_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_v4_static_binding.go b/nsxt/resource_nsxt_policy_dhcp_v4_static_binding.go index 468364228..69b815f9c 100644 --- a/nsxt/resource_nsxt_policy_dhcp_v4_static_binding.go +++ b/nsxt/resource_nsxt_policy_dhcp_v4_static_binding.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_v4_static_binding_test.go b/nsxt/resource_nsxt_policy_dhcp_v4_static_binding_test.go index 4dc4527d6..387e5b5b8 100644 --- a/nsxt/resource_nsxt_policy_dhcp_v4_static_binding_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_v4_static_binding_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_v6_static_binding.go b/nsxt/resource_nsxt_policy_dhcp_v6_static_binding.go index 5396d6e04..62664017a 100644 --- a/nsxt/resource_nsxt_policy_dhcp_v6_static_binding.go +++ b/nsxt/resource_nsxt_policy_dhcp_v6_static_binding.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dhcp_v6_static_binding_test.go b/nsxt/resource_nsxt_policy_dhcp_v6_static_binding_test.go index 3141586a9..85570646c 100644 --- a/nsxt/resource_nsxt_policy_dhcp_v6_static_binding_test.go +++ b/nsxt/resource_nsxt_policy_dhcp_v6_static_binding_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile.go b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile.go index 9f1b373a7..1a46d7522 100644 --- a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile.go +++ b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -18,6 +19,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var distributedFloodProtectionProfilePathExample = getMultitenancyPathExample("/infra/flood-protection-profiles/[profile]") + func resourceNsxtPolicyDistributedFloodProtectionProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyDistributedFloodProtectionProfileCreate, @@ -25,7 +28,7 @@ func resourceNsxtPolicyDistributedFloodProtectionProfile() *schema.Resource { Update: resourceNsxtPolicyDistributedFloodProtectionProfileUpdate, Delete: resourceNsxtPolicyFloodProtectionProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(distributedFloodProtectionProfilePathExample), }, Schema: getDistributedFloodProtectionProfile(), } diff --git a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding.go b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding.go index 6f377f585..2cf2e53a5 100644 --- a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding.go +++ b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding_test.go b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding_test.go index 9ec987acf..0c42b5382 100644 --- a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding_test.go +++ b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_binding_test.go @@ -1,5 +1,6 @@ -//* Copyright © 2024 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 // This test file tests both distributed_flood_protection_profile and distributed_flood_protection_profile_binding package nsxt @@ -197,7 +198,7 @@ resource "nsxt_policy_distributed_flood_protection_profile_binding" "%s" { %s display_name = "%s" description = "%s" - profile_path = nsxt_policy_distributed_flood_protection_profile.%s.path + profile_path = nsxt_policy_distributed_flood_protection_profile.%s.path group_path = nsxt_policy_group.test.path sequence_number = %s diff --git a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_test.go b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_test.go index 41530a004..d838bf44b 100644 --- a/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_test.go +++ b/nsxt/resource_nsxt_policy_distributed_flood_protection_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_distributed_vlan_connection.go b/nsxt/resource_nsxt_policy_distributed_vlan_connection.go index 5b7a4c1b9..aa19fe6bb 100644 --- a/nsxt/resource_nsxt_policy_distributed_vlan_connection.go +++ b/nsxt/resource_nsxt_policy_distributed_vlan_connection.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -54,6 +55,8 @@ var distributedVlanConnectionSchema = map[string]*metadata.ExtendedSchema{ }, } +const distributedVlanConnectionPathExample = "/infra/distributed-vlan-connections/[connection]" + func resourceNsxtPolicyDistributedVlanConnection() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyDistributedVlanConnectionCreate, @@ -61,7 +64,7 @@ func resourceNsxtPolicyDistributedVlanConnection() *schema.Resource { Update: resourceNsxtPolicyDistributedVlanConnectionUpdate, Delete: resourceNsxtPolicyDistributedVlanConnectionDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(distributedVlanConnectionPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(distributedVlanConnectionSchema), } diff --git a/nsxt/resource_nsxt_policy_distributed_vlan_connection_test.go b/nsxt/resource_nsxt_policy_distributed_vlan_connection_test.go index 5fcc79db1..0df3ec49e 100644 --- a/nsxt/resource_nsxt_policy_distributed_vlan_connection_test.go +++ b/nsxt/resource_nsxt_policy_distributed_vlan_connection_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_dns_forwarder_zone.go b/nsxt/resource_nsxt_policy_dns_forwarder_zone.go index 52b20f54b..8aa09cc66 100644 --- a/nsxt/resource_nsxt_policy_dns_forwarder_zone.go +++ b/nsxt/resource_nsxt_policy_dns_forwarder_zone.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -16,6 +17,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var dnsForwarderZonePath string = getMultitenancyPathExample("/infra/dns-forwarder-zones/[profile]") + func resourceNsxtPolicyDNSForwarderZone() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyDNSForwarderZoneCreate, @@ -23,7 +26,7 @@ func resourceNsxtPolicyDNSForwarderZone() *schema.Resource { Update: resourceNsxtPolicyDNSForwarderZoneUpdate, Delete: resourceNsxtPolicyDNSForwarderZoneDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(dnsForwarderZonePath), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_dns_forwarder_zone_test.go b/nsxt/resource_nsxt_policy_dns_forwarder_zone_test.go index ef139d524..601ad305b 100644 --- a/nsxt/resource_nsxt_policy_dns_forwarder_zone_test.go +++ b/nsxt/resource_nsxt_policy_dns_forwarder_zone_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_domain.go b/nsxt/resource_nsxt_policy_domain.go index dbf2852bf..10c5b5a45 100644 --- a/nsxt/resource_nsxt_policy_domain.go +++ b/nsxt/resource_nsxt_policy_domain.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_domain_test.go b/nsxt/resource_nsxt_policy_domain_test.go index 51040d3bb..f5cbac48f 100644 --- a/nsxt/resource_nsxt_policy_domain_test.go +++ b/nsxt/resource_nsxt_policy_domain_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_config.go b/nsxt/resource_nsxt_policy_evpn_config.go index d391593ac..9ae01ddb5 100644 --- a/nsxt/resource_nsxt_policy_evpn_config.go +++ b/nsxt/resource_nsxt_policy_evpn_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_config_test.go b/nsxt/resource_nsxt_policy_evpn_config_test.go index 2e65f0eba..029914689 100644 --- a/nsxt/resource_nsxt_policy_evpn_config_test.go +++ b/nsxt/resource_nsxt_policy_evpn_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_tenant.go b/nsxt/resource_nsxt_policy_evpn_tenant.go index dcc61fcee..944a78145 100644 --- a/nsxt/resource_nsxt_policy_evpn_tenant.go +++ b/nsxt/resource_nsxt_policy_evpn_tenant.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_tenant_test.go b/nsxt/resource_nsxt_policy_evpn_tenant_test.go index eb1115940..f4dcfeb2f 100644 --- a/nsxt/resource_nsxt_policy_evpn_tenant_test.go +++ b/nsxt/resource_nsxt_policy_evpn_tenant_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint.go b/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint.go index a1a362a63..48fc2c9cc 100644 --- a/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint.go +++ b/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint_test.go b/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint_test.go index 31d68813d..7d2971b6b 100644 --- a/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint_test.go +++ b/nsxt/resource_nsxt_policy_evpn_tunnel_endpoint_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_firewall_exclude_list_member.go b/nsxt/resource_nsxt_policy_firewall_exclude_list_member.go index 672b6759a..acc2d27c5 100644 --- a/nsxt/resource_nsxt_policy_firewall_exclude_list_member.go +++ b/nsxt/resource_nsxt_policy_firewall_exclude_list_member.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_firewall_exclude_list_member_test.go b/nsxt/resource_nsxt_policy_firewall_exclude_list_member_test.go index 762256755..26f2f55f7 100644 --- a/nsxt/resource_nsxt_policy_firewall_exclude_list_member_test.go +++ b/nsxt/resource_nsxt_policy_firewall_exclude_list_member_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_fixed_segment.go b/nsxt/resource_nsxt_policy_fixed_segment.go index 68709a53c..67528fd8c 100644 --- a/nsxt/resource_nsxt_policy_fixed_segment.go +++ b/nsxt/resource_nsxt_policy_fixed_segment.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_fixed_segment_test.go b/nsxt/resource_nsxt_policy_fixed_segment_test.go index dd0568997..f23c70e14 100644 --- a/nsxt/resource_nsxt_policy_fixed_segment_test.go +++ b/nsxt/resource_nsxt_policy_fixed_segment_test.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/resource_nsxt_policy_gateway_community_list.go b/nsxt/resource_nsxt_policy_gateway_community_list.go index ef157773b..7f9f2f38c 100644 --- a/nsxt/resource_nsxt_policy_gateway_community_list.go +++ b/nsxt/resource_nsxt_policy_gateway_community_list.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_community_list_test.go b/nsxt/resource_nsxt_policy_gateway_community_list_test.go index ef8147414..c8cf11c30 100644 --- a/nsxt/resource_nsxt_policy_gateway_community_list_test.go +++ b/nsxt/resource_nsxt_policy_gateway_community_list_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_connection.go b/nsxt/resource_nsxt_policy_gateway_connection.go index 91e07bef5..032f8b8cb 100644 --- a/nsxt/resource_nsxt_policy_gateway_connection.go +++ b/nsxt/resource_nsxt_policy_gateway_connection.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -73,6 +74,8 @@ var gatewayConnectionSchema = map[string]*metadata.ExtendedSchema{ }, } +var gatewayConnectionPathExample = "/infra/gateway-connections/[connection]" + func resourceNsxtPolicyGatewayConnection() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyGatewayConnectionCreate, @@ -80,7 +83,7 @@ func resourceNsxtPolicyGatewayConnection() *schema.Resource { Update: resourceNsxtPolicyGatewayConnectionUpdate, Delete: resourceNsxtPolicyGatewayConnectionDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(gatewayConnectionPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(gatewayConnectionSchema), } diff --git a/nsxt/resource_nsxt_policy_gateway_connection_test.go b/nsxt/resource_nsxt_policy_gateway_connection_test.go index b08626cef..d8a9f24ca 100644 --- a/nsxt/resource_nsxt_policy_gateway_connection_test.go +++ b/nsxt/resource_nsxt_policy_gateway_connection_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_dns_forwarder.go b/nsxt/resource_nsxt_policy_gateway_dns_forwarder.go index fa4df3506..d2aae3bff 100644 --- a/nsxt/resource_nsxt_policy_gateway_dns_forwarder.go +++ b/nsxt/resource_nsxt_policy_gateway_dns_forwarder.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_dns_forwarder_test.go b/nsxt/resource_nsxt_policy_gateway_dns_forwarder_test.go index e2a1259c1..19ab158c4 100644 --- a/nsxt/resource_nsxt_policy_gateway_dns_forwarder_test.go +++ b/nsxt/resource_nsxt_policy_gateway_dns_forwarder_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile.go b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile.go index 00256c1f8..d3ae87607 100644 --- a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile.go +++ b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( "github.com/vmware/terraform-provider-nsxt/api/infra" ) +var gatewayFloodProtectionProfilePathExample = getMultitenancyPathExample("/infra/flood-protection-profiles/[profile]") + func resourceNsxtPolicyGatewayFloodProtectionProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyGatewayFloodProtectionProfileCreate, @@ -22,7 +25,7 @@ func resourceNsxtPolicyGatewayFloodProtectionProfile() *schema.Resource { Update: resourceNsxtPolicyGatewayFloodProtectionProfileUpdate, Delete: resourceNsxtPolicyFloodProtectionProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(gatewayFloodProtectionProfilePathExample), }, Schema: getGatewayFloodProtectionProfile(), } diff --git a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding.go b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding.go index 4e9b5f228..30348d745 100644 --- a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding.go +++ b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding_test.go b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding_test.go index 35d41a1f6..5996a91c8 100644 --- a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding_test.go +++ b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_binding_test.go @@ -1,5 +1,6 @@ -//* Copyright © 2024 VMware, Inc. All Rights Reserved. -// SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 // This test file tests both distributed_flood_protection_profile and distributed_flood_protection_profile_binding package nsxt @@ -242,7 +243,7 @@ resource "nsxt_policy_gateway_flood_protection_profile_binding" "%s" { %s display_name = "%s" description = "%s" - profile_path = nsxt_policy_gateway_flood_protection_profile.%s.path + profile_path = nsxt_policy_gateway_flood_protection_profile.%s.path parent_path = %s tag { diff --git a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_test.go b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_test.go index c395d894c..cd4c77f46 100644 --- a/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_test.go +++ b/nsxt/resource_nsxt_policy_gateway_flood_protection_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -252,7 +253,7 @@ func testAccNsxtPolicyGatewayFloodProtectionProfileMinimalistic(withContext bool } return fmt.Sprintf(` resource "nsxt_policy_gateway_flood_protection_profile" "test" { -%s +%s display_name = "%s" }`, context, name) diff --git a/nsxt/resource_nsxt_policy_gateway_policy.go b/nsxt/resource_nsxt_policy_gateway_policy.go index 0bbe0d703..4966bd934 100644 --- a/nsxt/resource_nsxt_policy_gateway_policy.go +++ b/nsxt/resource_nsxt_policy_gateway_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_policy_test.go b/nsxt/resource_nsxt_policy_gateway_policy_test.go index a99092479..406ee8e97 100644 --- a/nsxt/resource_nsxt_policy_gateway_policy_test.go +++ b/nsxt/resource_nsxt_policy_gateway_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -938,12 +939,12 @@ func testAccNsxtPolicyGatewayPolicyWithIPCidrRange(name string, destIP string, d locked = false stateful = true tcp_strict = false - + tag { scope = "color" tag = "orange" } - + rule { display_name = "rule1" source_groups = [nsxt_policy_group.group1.path] @@ -960,7 +961,7 @@ func testAccNsxtPolicyGatewayPolicyWithIPCidrRange(name string, destIP string, d services = [nsxt_policy_service.icmp.path] scope = [nsxt_policy_tier1_gateway.gwt1test.path] action = "ALLOW" - } + } rule { display_name = "rule3" diff --git a/nsxt/resource_nsxt_policy_gateway_prefix_list.go b/nsxt/resource_nsxt_policy_gateway_prefix_list.go index 2bebc4c9c..d03175d8d 100644 --- a/nsxt/resource_nsxt_policy_gateway_prefix_list.go +++ b/nsxt/resource_nsxt_policy_gateway_prefix_list.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_prefix_list_test.go b/nsxt/resource_nsxt_policy_gateway_prefix_list_test.go index 3fae26f11..74a3da4f7 100644 --- a/nsxt/resource_nsxt_policy_gateway_prefix_list_test.go +++ b/nsxt/resource_nsxt_policy_gateway_prefix_list_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_qos_profile.go b/nsxt/resource_nsxt_policy_gateway_qos_profile.go index d54839423..ccc7ed92f 100644 --- a/nsxt/resource_nsxt_policy_gateway_qos_profile.go +++ b/nsxt/resource_nsxt_policy_gateway_qos_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_qos_profile_test.go b/nsxt/resource_nsxt_policy_gateway_qos_profile_test.go index fa1daa20d..0e305c4bb 100644 --- a/nsxt/resource_nsxt_policy_gateway_qos_profile_test.go +++ b/nsxt/resource_nsxt_policy_gateway_qos_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_redistribution_config.go b/nsxt/resource_nsxt_policy_gateway_redistribution_config.go index 193789f98..d6daffb1f 100644 --- a/nsxt/resource_nsxt_policy_gateway_redistribution_config.go +++ b/nsxt/resource_nsxt_policy_gateway_redistribution_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_redistribution_config_test.go b/nsxt/resource_nsxt_policy_gateway_redistribution_config_test.go index 10085e6d5..7272a71a9 100644 --- a/nsxt/resource_nsxt_policy_gateway_redistribution_config_test.go +++ b/nsxt/resource_nsxt_policy_gateway_redistribution_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_route_map.go b/nsxt/resource_nsxt_policy_gateway_route_map.go index ddc5dc383..57c403465 100644 --- a/nsxt/resource_nsxt_policy_gateway_route_map.go +++ b/nsxt/resource_nsxt_policy_gateway_route_map.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_gateway_route_map_test.go b/nsxt/resource_nsxt_policy_gateway_route_map_test.go index 7c82ca7cc..f1ea2ad32 100644 --- a/nsxt/resource_nsxt_policy_gateway_route_map_test.go +++ b/nsxt/resource_nsxt_policy_gateway_route_map_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -209,7 +210,7 @@ resource "nsxt_policy_gateway_route_map" "test" { weight = 12 } } - + entry { action = "DENY" community_list_match { diff --git a/nsxt/resource_nsxt_policy_global_manager.go b/nsxt/resource_nsxt_policy_global_manager.go index 7e7f44277..55d9e65cf 100644 --- a/nsxt/resource_nsxt_policy_global_manager.go +++ b/nsxt/resource_nsxt_policy_global_manager.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -18,6 +19,8 @@ var globalManagerModeValues = []string{ gm_model.GlobalManager_MODE_STANDBY, } +var globalManagerPathExample = "/global-infra/global-managers/[manager]" + func resourceNsxtPolicyGlobalManager() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyGlobalManagerCreate, @@ -25,7 +28,7 @@ func resourceNsxtPolicyGlobalManager() *schema.Resource { Update: resourceNsxtPolicyGlobalManagerUpdate, Delete: resourceNsxtPolicyGlobalManagerDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(globalManagerPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_group.go b/nsxt/resource_nsxt_policy_group.go index 8154f56ae..870dd2ae7 100644 --- a/nsxt/resource_nsxt_policy_group.go +++ b/nsxt/resource_nsxt_policy_group.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_host_transport_node.go b/nsxt/resource_nsxt_policy_host_transport_node.go index 6dfadb738..7a90f938b 100644 --- a/nsxt/resource_nsxt_policy_host_transport_node.go +++ b/nsxt/resource_nsxt_policy_host_transport_node.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_host_transport_node_collection.go b/nsxt/resource_nsxt_policy_host_transport_node_collection.go index a90d4f20e..46154640b 100644 --- a/nsxt/resource_nsxt_policy_host_transport_node_collection.go +++ b/nsxt/resource_nsxt_policy_host_transport_node_collection.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_host_transport_node_profile.go b/nsxt/resource_nsxt_policy_host_transport_node_profile.go index 776898086..2106ec56b 100644 --- a/nsxt/resource_nsxt_policy_host_transport_node_profile.go +++ b/nsxt/resource_nsxt_policy_host_transport_node_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -12,6 +13,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" ) +var hostTransportNodeProfilePathExample = "/infra/host-transport-node-profiles/[profile]" + func resourceNsxtPolicyHostTransportNodeProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyHostTransportNodeProfileCreate, @@ -19,7 +22,7 @@ func resourceNsxtPolicyHostTransportNodeProfile() *schema.Resource { Update: resourceNsxtPolicyHostTransportNodeProfileUpdate, Delete: resourceNsxtPolicyHostTransportNodeProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(hostTransportNodeProfilePathExample), }, Schema: map[string]*schema.Schema{ "nsx_id": getNsxIDSchema(), diff --git a/nsxt/resource_nsxt_policy_intrusion_service_policy.go b/nsxt/resource_nsxt_policy_intrusion_service_policy.go index b81789ad3..f7e432078 100644 --- a/nsxt/resource_nsxt_policy_intrusion_service_policy.go +++ b/nsxt/resource_nsxt_policy_intrusion_service_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_intrusion_service_policy_test.go b/nsxt/resource_nsxt_policy_intrusion_service_policy_test.go index c9b6b2669..8e5aadc21 100644 --- a/nsxt/resource_nsxt_policy_intrusion_service_policy_test.go +++ b/nsxt/resource_nsxt_policy_intrusion_service_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_intrusion_service_profile.go b/nsxt/resource_nsxt_policy_intrusion_service_profile.go index db5c8e367..9539dfeec 100644 --- a/nsxt/resource_nsxt_policy_intrusion_service_profile.go +++ b/nsxt/resource_nsxt_policy_intrusion_service_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -39,6 +40,8 @@ var idsProfileSignatureActionValues = []string{ model.IdsProfileLocalSignature_ACTION_REJECT, } +var intrusionServiceProfilePathExample = getMultitenancyPathExample("/infra/settings/firewall/security/intrusion-services/profiles/[profile]") + func resourceNsxtPolicyIntrusionServiceProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyIntrusionServiceProfileCreate, @@ -46,7 +49,7 @@ func resourceNsxtPolicyIntrusionServiceProfile() *schema.Resource { Update: resourceNsxtPolicyIntrusionServiceProfileUpdate, Delete: resourceNsxtPolicyIntrusionServiceProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(intrusionServiceProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_intrusion_service_profile_test.go b/nsxt/resource_nsxt_policy_intrusion_service_profile_test.go index 68a69debe..b6e29a22b 100644 --- a/nsxt/resource_nsxt_policy_intrusion_service_profile_test.go +++ b/nsxt/resource_nsxt_policy_intrusion_service_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_address_allocation.go b/nsxt/resource_nsxt_policy_ip_address_allocation.go index 2eb876309..5acc70ac3 100644 --- a/nsxt/resource_nsxt_policy_ip_address_allocation.go +++ b/nsxt/resource_nsxt_policy_ip_address_allocation.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_address_allocation_test.go b/nsxt/resource_nsxt_policy_ip_address_allocation_test.go index 30c54485a..60c6f1e16 100644 --- a/nsxt/resource_nsxt_policy_ip_address_allocation_test.go +++ b/nsxt/resource_nsxt_policy_ip_address_allocation_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_block.go b/nsxt/resource_nsxt_policy_ip_block.go index 27e85f97e..739e106b8 100644 --- a/nsxt/resource_nsxt_policy_ip_block.go +++ b/nsxt/resource_nsxt_policy_ip_block.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -22,6 +23,8 @@ var visibilityTypes = []string{ model.IpAddressBlock_VISIBILITY_PRIVATE, } +var ipBlockPathExample = getMultitenancyPathExample("/infra/ip-blocks/[ip-block]") + func resourceNsxtPolicyIPBlock() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyIPBlockCreate, @@ -29,7 +32,7 @@ func resourceNsxtPolicyIPBlock() *schema.Resource { Update: resourceNsxtPolicyIPBlockUpdate, Delete: resourceNsxtPolicyIPBlockDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(ipBlockPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_ip_block_test.go b/nsxt/resource_nsxt_policy_ip_block_test.go index 61060d962..418afb2a6 100644 --- a/nsxt/resource_nsxt_policy_ip_block_test.go +++ b/nsxt/resource_nsxt_policy_ip_block_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_discovery_profile.go b/nsxt/resource_nsxt_policy_ip_discovery_profile.go index 4e8f5f095..706642d90 100644 --- a/nsxt/resource_nsxt_policy_ip_discovery_profile.go +++ b/nsxt/resource_nsxt_policy_ip_discovery_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -16,6 +17,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var ipDiscoveryProfilePathExample = getMultitenancyPathExample("/infra/ip-discovery-profiles/[profile]") + func resourceNsxtPolicyIPDiscoveryProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyIPDiscoveryProfileCreate, @@ -23,7 +26,7 @@ func resourceNsxtPolicyIPDiscoveryProfile() *schema.Resource { Update: resourceNsxtPolicyIPDiscoveryProfileUpdate, Delete: resourceNsxtPolicyIPDiscoveryProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(ipDiscoveryProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_ip_discovery_profile_test.go b/nsxt/resource_nsxt_policy_ip_discovery_profile_test.go index deb428013..7ec72f51e 100644 --- a/nsxt/resource_nsxt_policy_ip_discovery_profile_test.go +++ b/nsxt/resource_nsxt_policy_ip_discovery_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_pool.go b/nsxt/resource_nsxt_policy_ip_pool.go index 54238a1db..73189f440 100644 --- a/nsxt/resource_nsxt_policy_ip_pool.go +++ b/nsxt/resource_nsxt_policy_ip_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var ipPoolPathExample = getMultitenancyPathExample("/infra/ip-pools/[ip-pool]") + func resourceNsxtPolicyIPPool() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyIPPoolCreate, @@ -22,7 +25,7 @@ func resourceNsxtPolicyIPPool() *schema.Resource { Update: resourceNsxtPolicyIPPoolUpdate, Delete: resourceNsxtPolicyIPPoolDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(ipPoolPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_ip_pool_block_subnet.go b/nsxt/resource_nsxt_policy_ip_pool_block_subnet.go index 2a9284e4c..c15b94716 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_block_subnet.go +++ b/nsxt/resource_nsxt_policy_ip_pool_block_subnet.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go b/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go index 749320665..df65a5b1b 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_block_subnet_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_pool_static_subnet.go b/nsxt/resource_nsxt_policy_ip_pool_static_subnet.go index c96e4a496..40a05af35 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_static_subnet.go +++ b/nsxt/resource_nsxt_policy_ip_pool_static_subnet.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go b/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go index 60f722f4f..128eec7f0 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_static_subnet_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ip_pool_test.go b/nsxt/resource_nsxt_policy_ip_pool_test.go index 6cedbaa86..f420a0d94 100644 --- a/nsxt/resource_nsxt_policy_ip_pool_test.go +++ b/nsxt/resource_nsxt_policy_ip_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile.go b/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile.go index 42e6ed05e..fba3e058e 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile_test.go index 9306e2a0e..39f2ed84d 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_dpd_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile.go b/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile.go index 29e8403ca..ca66a6e1f 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile_test.go index 27ba75775..3b64a0890 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_ike_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint.go b/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint.go index 15b0fcd62..6b4f26170 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint_test.go index e79c11a05..7606b67d8 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_local_endpoint_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_service.go b/nsxt/resource_nsxt_policy_ipsec_vpn_service.go index ec14ab223..d0c289e57 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_service.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_service_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_service_test.go index d65c17396..1ddcbd2cc 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_service_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_session.go b/nsxt/resource_nsxt_policy_ipsec_vpn_session.go index 5a7e1fa72..b928eab4b 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_session.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_session.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_session_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_session_test.go index 5facc7dcc..02b08242f 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_session_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_session_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -628,7 +629,7 @@ resource "nsxt_policy_ipsec_vpn_local_endpoint" "test" { service_path = nsxt_policy_ipsec_vpn_service.test_ipsec_svc.path display_name = "%s" local_address = "20.20.0.25" - } + } `, ipsecVpnResourceName) } var vpnServiceTemplate string diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile.go b/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile.go index 2eba04565..efff95819 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile_test.go b/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile_test.go index f593f53c9..9227cec69 100644 --- a/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile_test.go +++ b/nsxt/resource_nsxt_policy_ipsec_vpn_tunnel_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_l2_vpn_service.go b/nsxt/resource_nsxt_policy_l2_vpn_service.go index 616bafabf..687d1ea2e 100644 --- a/nsxt/resource_nsxt_policy_l2_vpn_service.go +++ b/nsxt/resource_nsxt_policy_l2_vpn_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_l2_vpn_service_test.go b/nsxt/resource_nsxt_policy_l2_vpn_service_test.go index 8cd8bfafd..30b22ef88 100644 --- a/nsxt/resource_nsxt_policy_l2_vpn_service_test.go +++ b/nsxt/resource_nsxt_policy_l2_vpn_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_l2_vpn_session.go b/nsxt/resource_nsxt_policy_l2_vpn_session.go index 8007d9ff1..8b14e6515 100644 --- a/nsxt/resource_nsxt_policy_l2_vpn_session.go +++ b/nsxt/resource_nsxt_policy_l2_vpn_session.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_l2_vpn_session_test.go b/nsxt/resource_nsxt_policy_l2_vpn_session_test.go index 4c80b48a1..2af973769 100644 --- a/nsxt/resource_nsxt_policy_l2_vpn_session_test.go +++ b/nsxt/resource_nsxt_policy_l2_vpn_session_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2022 VMware, Inc. All Rights Reserved. -SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_client_ssl_profile.go b/nsxt/resource_nsxt_policy_lb_client_ssl_profile.go index ba567d778..676d511b9 100644 --- a/nsxt/resource_nsxt_policy_lb_client_ssl_profile.go +++ b/nsxt/resource_nsxt_policy_lb_client_ssl_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -21,6 +22,8 @@ var lBClientSslProfileCipherGroupLabelValues = []string{ model.LBClientSslProfile_CIPHER_GROUP_LABEL_BALANCED, } +var lbClientSslProfilePathExample = "/infra/lb-client-ssl-profiles/[profile]" + func resourceNsxtPolicyLBClientSslProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyLBClientSslProfileCreate, @@ -28,7 +31,7 @@ func resourceNsxtPolicyLBClientSslProfile() *schema.Resource { Update: resourceNsxtPolicyLBClientSslProfileUpdate, Delete: resourceNsxtPolicyLBClientSslProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbClientSslProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_client_ssl_profile_test.go b/nsxt/resource_nsxt_policy_lb_client_ssl_profile_test.go index cce45906b..8f72092bd 100644 --- a/nsxt/resource_nsxt_policy_lb_client_ssl_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_client_ssl_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_http_application_profile.go b/nsxt/resource_nsxt_policy_lb_http_application_profile.go index 71ebd567c..d704a4894 100644 --- a/nsxt/resource_nsxt_policy_lb_http_application_profile.go +++ b/nsxt/resource_nsxt_policy_lb_http_application_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -21,6 +22,8 @@ var lBHttpProfileXForwardedForValues = []string{ model.LBHttpProfile_X_FORWARDED_FOR_INSERT, } +var lbHttpApplucationProfilePathExample = "/infra/lb-app-profiles/[profile]" + func resourceNsxtPolicyLBHttpApplicationProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyLBHttpApplicationProfileCreate, @@ -28,7 +31,7 @@ func resourceNsxtPolicyLBHttpApplicationProfile() *schema.Resource { Update: resourceNsxtPolicyLBHttpApplicationProfileUpdate, Delete: resourceNsxtPolicyLBHttpApplicationProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbHttpApplucationProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_http_application_profile_test.go b/nsxt/resource_nsxt_policy_lb_http_application_profile_test.go index 1ac49f5fa..6c24e3536 100644 --- a/nsxt/resource_nsxt_policy_lb_http_application_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_http_application_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_http_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_http_monitor_profile.go index fd72b9bd2..47721a3bb 100644 --- a/nsxt/resource_nsxt_policy_lb_http_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_http_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -14,6 +15,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" ) +var lbMonitorProfilePathExample = "/infra/lb-monitor-profiles/[profile]" + func resourceNsxtPolicyLBHttpMonitorProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyLBHttpMonitorProfileCreate, @@ -21,7 +24,7 @@ func resourceNsxtPolicyLBHttpMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBHttpMonitorProfileUpdate, Delete: resourceNsxtPolicyLBHttpMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_http_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_http_monitor_profile_test.go index 2a2c3520c..ee290e259 100644 --- a/nsxt/resource_nsxt_policy_lb_http_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_http_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_https_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_https_monitor_profile.go index b2de79d6f..a03b68687 100644 --- a/nsxt/resource_nsxt_policy_lb_https_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_https_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -27,7 +28,7 @@ func resourceNsxtPolicyLBHttpsMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBHttpsMonitorProfileUpdate, Delete: resourceNsxtPolicyLBHttpsMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_https_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_https_monitor_profile_test.go index fd5f9f49a..87bb3dad9 100644 --- a/nsxt/resource_nsxt_policy_lb_https_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_https_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile.go index 89e4b34c5..5bcea1ccd 100644 --- a/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -21,7 +22,7 @@ func resourceNsxtPolicyLBIcmpMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBIcmpMonitorProfileUpdate, Delete: resourceNsxtPolicyLBIcmpMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile_test.go index abcdcb3b6..689cc53ec 100644 --- a/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_icmp_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_passive_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_passive_monitor_profile.go index 1e9214deb..cb83039f2 100644 --- a/nsxt/resource_nsxt_policy_lb_passive_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_passive_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -22,7 +23,7 @@ func resourceNsxtPolicyLBPassiveMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBPassiveMonitorProfileUpdate, Delete: resourceNsxtPolicyLBPassiveMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_passive_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_passive_monitor_profile_test.go index 6b6bc35cd..4bc258d72 100644 --- a/nsxt/resource_nsxt_policy_lb_passive_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_passive_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_pool.go b/nsxt/resource_nsxt_policy_lb_pool.go index 7e0abb5e8..12b313b7d 100644 --- a/nsxt/resource_nsxt_policy_lb_pool.go +++ b/nsxt/resource_nsxt_policy_lb_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_pool_test.go b/nsxt/resource_nsxt_policy_lb_pool_test.go index 1e5f26633..8d542619f 100644 --- a/nsxt/resource_nsxt_policy_lb_pool_test.go +++ b/nsxt/resource_nsxt_policy_lb_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_service.go b/nsxt/resource_nsxt_policy_lb_service.go index dfc4bd6ff..4ef388fb4 100644 --- a/nsxt/resource_nsxt_policy_lb_service.go +++ b/nsxt/resource_nsxt_policy_lb_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_service_test.go b/nsxt/resource_nsxt_policy_lb_service_test.go index 869bc0c18..fd11ad731 100644 --- a/nsxt/resource_nsxt_policy_lb_service_test.go +++ b/nsxt/resource_nsxt_policy_lb_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile.go index d410d0a51..409516a3e 100644 --- a/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -21,7 +22,7 @@ func resourceNsxtPolicyLBTcpMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBTcpMonitorProfileUpdate, Delete: resourceNsxtPolicyLBTcpMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile_test.go index e70cba801..4635a5c70 100644 --- a/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_tcp_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_udp_monitor_profile.go b/nsxt/resource_nsxt_policy_lb_udp_monitor_profile.go index 725d4ee31..a4bd6361f 100644 --- a/nsxt/resource_nsxt_policy_lb_udp_monitor_profile.go +++ b/nsxt/resource_nsxt_policy_lb_udp_monitor_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -21,7 +22,7 @@ func resourceNsxtPolicyLBUdpMonitorProfile() *schema.Resource { Update: resourceNsxtPolicyLBUdpMonitorProfileUpdate, Delete: resourceNsxtPolicyLBUdpMonitorProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(lbMonitorProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_lb_udp_monitor_profile_test.go b/nsxt/resource_nsxt_policy_lb_udp_monitor_profile_test.go index a9f4c0546..513de11ee 100644 --- a/nsxt/resource_nsxt_policy_lb_udp_monitor_profile_test.go +++ b/nsxt/resource_nsxt_policy_lb_udp_monitor_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_virtual_server.go b/nsxt/resource_nsxt_policy_lb_virtual_server.go index 156756b30..7828fa0df 100644 --- a/nsxt/resource_nsxt_policy_lb_virtual_server.go +++ b/nsxt/resource_nsxt_policy_lb_virtual_server.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_lb_virtual_server_test.go b/nsxt/resource_nsxt_policy_lb_virtual_server_test.go index 02d494680..fd884e9a2 100644 --- a/nsxt/resource_nsxt_policy_lb_virtual_server_test.go +++ b/nsxt/resource_nsxt_policy_lb_virtual_server_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -932,7 +933,7 @@ resource "nsxt_policy_lb_virtual_server" "test" { } condition { http_request_body { - body_value = "xyz" + body_value = "xyz" match_type = "REGEX" } } @@ -968,7 +969,7 @@ resource "nsxt_policy_lb_virtual_server" "test" { } condition { http_request_header { - header_name = "my_head" + header_name = "my_head" header_value = "has_hair" match_type = "REGEX" } @@ -990,11 +991,11 @@ resource "nsxt_policy_lb_virtual_server" "test" { condition { http_request_uri_arguments { uri_arguments = "foo=bar" - match_type = "REGEX" + match_type = "REGEX" } http_request_uri { uri = "xyz" - match_type = "REGEX" + match_type = "REGEX" } } } @@ -1060,13 +1061,13 @@ resource "nsxt_policy_lb_virtual_server" "test" { action { select_pool { pool_id = nsxt_policy_lb_pool.pool.path - } + } } condition { ssl_sni { match_type = "REGEX" sni = "HELO" - } + } } } rule { @@ -1082,11 +1083,11 @@ resource "nsxt_policy_lb_virtual_server" "test" { variable { variable_name = "my_var" variable_value = "my_value" - match_type = "REGEX" - } + match_type = "REGEX" + } tcp_header { - source_port = "80" - } + source_port = "80" + } } } rule { @@ -1097,19 +1098,19 @@ resource "nsxt_policy_lb_virtual_server" "test" { persistence_profile_path = data.nsxt_policy_lb_persistence_profile.generic.path variable_hash_enabled = true variable_name = "my_name" - } + } } condition { http_ssl { session_reused = "IGNORE" used_protocol = "TLS_V1_2" - used_ssl_cipher = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + used_ssl_cipher = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" client_certificate_issuer_dn { issuer_dn = "something" match_type = "REGEX" } client_certificate_subject_dn { - subject_dn = "something" + subject_dn = "something" match_type = "REGEX" } client_supported_ssl_ciphers = [ "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" ] @@ -1123,12 +1124,12 @@ resource "nsxt_policy_lb_virtual_server" "test" { variable_persistence_learn { persistence_profile_path = data.nsxt_policy_lb_persistence_profile.generic.path variable_name = "my_name" - } + } } condition { http_ssl { used_protocol = "TLS_V1_2" - used_ssl_cipher = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + used_ssl_cipher = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" } } } @@ -1140,7 +1141,7 @@ resource "nsxt_policy_lb_virtual_server" "test" { persistence_profile_path = data.nsxt_policy_lb_persistence_profile.generic.path variable_hash_enabled = false variable_name = "my_name" - } + } } } rule { diff --git a/nsxt/resource_nsxt_policy_ldap_identity_source.go b/nsxt/resource_nsxt_policy_ldap_identity_source.go index 3c0c8aab8..3452c6dec 100644 --- a/nsxt/resource_nsxt_policy_ldap_identity_source.go +++ b/nsxt/resource_nsxt_policy_ldap_identity_source.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ldap_identity_source_test.go b/nsxt/resource_nsxt_policy_ldap_identity_source_test.go index 6f1925a98..d1249f89b 100644 --- a/nsxt/resource_nsxt_policy_ldap_identity_source_test.go +++ b/nsxt/resource_nsxt_policy_ldap_identity_source_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_mac_discovery_profile.go b/nsxt/resource_nsxt_policy_mac_discovery_profile.go index 0974a7247..f5091c105 100644 --- a/nsxt/resource_nsxt_policy_mac_discovery_profile.go +++ b/nsxt/resource_nsxt_policy_mac_discovery_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -124,6 +125,8 @@ var macDiscoveryProfileSchema = map[string]*metadata.ExtendedSchema{ }, } +var macDiscoveryProfileExamplePath string = getMultitenancyPathExample("/infra/mac-discovery-profiles/[profile]") + func resourceNsxtPolicyMacDiscoveryProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyMacDiscoveryProfileCreate, @@ -131,7 +134,7 @@ func resourceNsxtPolicyMacDiscoveryProfile() *schema.Resource { Update: resourceNsxtPolicyMacDiscoveryProfileUpdate, Delete: resourceNsxtPolicyMacDiscoveryProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(macDiscoveryProfileExamplePath), }, Schema: metadata.GetSchemaFromExtendedSchema(macDiscoveryProfileSchema), diff --git a/nsxt/resource_nsxt_policy_mac_discovery_profile_test.go b/nsxt/resource_nsxt_policy_mac_discovery_profile_test.go index 2c38234c6..e586a8426 100644 --- a/nsxt/resource_nsxt_policy_mac_discovery_profile_test.go +++ b/nsxt/resource_nsxt_policy_mac_discovery_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_metadata_proxy.go b/nsxt/resource_nsxt_policy_metadata_proxy.go index cc98f263a..8460c96e4 100644 --- a/nsxt/resource_nsxt_policy_metadata_proxy.go +++ b/nsxt/resource_nsxt_policy_metadata_proxy.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( var cryptoProtocolsValues = []string{"TLS_V1", "TLS_V1_1", "TLS_V1_2"} +var metadataProxyPathExample = getMultitenancyPathExample("/infra/metadata-proxies/[profile]") + func resourceNsxtPolicyMetadataProxy() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyMetadataProxyCreate, @@ -22,7 +25,7 @@ func resourceNsxtPolicyMetadataProxy() *schema.Resource { Update: resourceNsxtPolicyMetadataProxyUpdate, Delete: resourceNsxtPolicyMetadataProxyDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(metadataProxyPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_metadata_proxy_test.go b/nsxt/resource_nsxt_policy_metadata_proxy_test.go index d21b0aea9..120184227 100644 --- a/nsxt/resource_nsxt_policy_metadata_proxy_test.go +++ b/nsxt/resource_nsxt_policy_metadata_proxy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_nat_rule.go b/nsxt/resource_nsxt_policy_nat_rule.go index e7d1b6f11..3205ad6f0 100644 --- a/nsxt/resource_nsxt_policy_nat_rule.go +++ b/nsxt/resource_nsxt_policy_nat_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_nat_rule_test.go b/nsxt/resource_nsxt_policy_nat_rule_test.go index bf492529c..6a5fa5370 100644 --- a/nsxt/resource_nsxt_policy_nat_rule_test.go +++ b/nsxt/resource_nsxt_policy_nat_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -583,7 +584,7 @@ resource "nsxt_policy_nat_rule" "test" { translated_networks = ["%s"] logging = false firewall_match = "%s" - service = data.nsxt_policy_service.test.path + service = data.nsxt_policy_service.test.path tag { scope = "scope1" @@ -620,7 +621,7 @@ resource "nsxt_policy_nat_rule" "test" { translated_networks = ["%s"] logging = false firewall_match = "%s" - service = data.nsxt_policy_service.test.path + service = data.nsxt_policy_service.test.path policy_based_vpn_mode = "%s" tag { @@ -742,12 +743,12 @@ func testAccNsxPolicyNatRuleNoTranslatedNetworkTemplate(name string, action stri destination_networks = ["%s"] logging = false firewall_match = "%s" - + tag { scope = "scope1" tag = "tag1" } - + tag { scope = "scope2" tag = "tag2" diff --git a/nsxt/resource_nsxt_policy_ospf_area.go b/nsxt/resource_nsxt_policy_ospf_area.go index 0689b0cb4..3801aec0d 100644 --- a/nsxt/resource_nsxt_policy_ospf_area.go +++ b/nsxt/resource_nsxt_policy_ospf_area.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ospf_area_test.go b/nsxt/resource_nsxt_policy_ospf_area_test.go index 40b5af71e..c5f1ff506 100644 --- a/nsxt/resource_nsxt_policy_ospf_area_test.go +++ b/nsxt/resource_nsxt_policy_ospf_area_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2021 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ospf_config.go b/nsxt/resource_nsxt_policy_ospf_config.go index 11d7677c5..67c138614 100644 --- a/nsxt/resource_nsxt_policy_ospf_config.go +++ b/nsxt/resource_nsxt_policy_ospf_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_ospf_config_test.go b/nsxt/resource_nsxt_policy_ospf_config_test.go index 6f566388b..4d6af6a78 100644 --- a/nsxt/resource_nsxt_policy_ospf_config_test.go +++ b/nsxt/resource_nsxt_policy_ospf_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_parent_security_policy.go b/nsxt/resource_nsxt_policy_parent_security_policy.go index 105130391..881782c81 100644 --- a/nsxt/resource_nsxt_policy_parent_security_policy.go +++ b/nsxt/resource_nsxt_policy_parent_security_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_parent_security_policy_test.go b/nsxt/resource_nsxt_policy_parent_security_policy_test.go index c7f732de6..bf556533c 100644 --- a/nsxt/resource_nsxt_policy_parent_security_policy_test.go +++ b/nsxt/resource_nsxt_policy_parent_security_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_predefined_gateway_policy.go b/nsxt/resource_nsxt_policy_predefined_gateway_policy.go index 377e12df6..26d3768cc 100644 --- a/nsxt/resource_nsxt_policy_predefined_gateway_policy.go +++ b/nsxt/resource_nsxt_policy_predefined_gateway_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_predefined_gateway_policy_test.go b/nsxt/resource_nsxt_policy_predefined_gateway_policy_test.go index e1dbd287a..b4619f181 100644 --- a/nsxt/resource_nsxt_policy_predefined_gateway_policy_test.go +++ b/nsxt/resource_nsxt_policy_predefined_gateway_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_predefined_security_policy.go b/nsxt/resource_nsxt_policy_predefined_security_policy.go index 97ec3363f..7b88b999a 100644 --- a/nsxt/resource_nsxt_policy_predefined_security_policy.go +++ b/nsxt/resource_nsxt_policy_predefined_security_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_predefined_security_policy_test.go b/nsxt/resource_nsxt_policy_predefined_security_policy_test.go index a3226bbd5..56e90ce86 100644 --- a/nsxt/resource_nsxt_policy_predefined_security_policy_test.go +++ b/nsxt/resource_nsxt_policy_predefined_security_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_project.go b/nsxt/resource_nsxt_policy_project.go index 312708ea7..2dff154ec 100644 --- a/nsxt/resource_nsxt_policy_project.go +++ b/nsxt/resource_nsxt_policy_project.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_project_ip_address_allocation.go b/nsxt/resource_nsxt_policy_project_ip_address_allocation.go index 825a95bbd..849cc0b96 100644 --- a/nsxt/resource_nsxt_policy_project_ip_address_allocation.go +++ b/nsxt/resource_nsxt_policy_project_ip_address_allocation.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -66,6 +67,8 @@ var projectIpAddressAllocationSchema = map[string]*metadata.ExtendedSchema{ }, } +var projectIpAddressAllocationPathExample = "/orgs/[org]/projects/[project]/ip-address-allocations/[allocation]" + func resourceNsxtPolicyProjectIpAddressAllocation() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyProjectIpAddressAllocationCreate, @@ -73,7 +76,7 @@ func resourceNsxtPolicyProjectIpAddressAllocation() *schema.Resource { Update: resourceNsxtPolicyProjectIpAddressAllocationUpdate, Delete: resourceNsxtPolicyProjectIpAddressAllocationDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(projectIpAddressAllocationPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(projectIpAddressAllocationSchema), } diff --git a/nsxt/resource_nsxt_policy_project_ip_address_allocation_test.go b/nsxt/resource_nsxt_policy_project_ip_address_allocation_test.go index af7a5bd1d..b7e3ab67d 100644 --- a/nsxt/resource_nsxt_policy_project_ip_address_allocation_test.go +++ b/nsxt/resource_nsxt_policy_project_ip_address_allocation_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_project_test.go b/nsxt/resource_nsxt_policy_project_test.go index 01d8ffa5d..2c5cfa226 100644 --- a/nsxt/resource_nsxt_policy_project_test.go +++ b/nsxt/resource_nsxt_policy_project_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -319,7 +320,7 @@ func TestAccResourceNsxtPolicyProject_900defaultSecurityProfile(t *testing.T) { // Create: Set T0, Ext GW connection, Ext IPv4 Block, activate default DFW Config: testAccNsxtPolicyProjectMinimalistic(), Check: resource.ComposeTestCheckFunc( - testAccNsxtPolicyProjectGetSecurityProfileNSEnabled(testResourceName, false), + testAccNsxtPolicyProjectGetSecurityProfileNSEnabled(testResourceName, true), ), }, { diff --git a/nsxt/resource_nsxt_policy_qos_profile.go b/nsxt/resource_nsxt_policy_qos_profile.go index 801425c8c..74ff32e10 100644 --- a/nsxt/resource_nsxt_policy_qos_profile.go +++ b/nsxt/resource_nsxt_policy_qos_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -18,7 +19,13 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) -var rateLimiterResourceTypes = []string{model.QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER, model.QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER, model.QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER} +var rateLimiterResourceTypes = []string{ + model.QosBaseRateLimiter_RESOURCE_TYPE_INGRESSRATELIMITER, + model.QosBaseRateLimiter_RESOURCE_TYPE_INGRESSBROADCASTRATELIMITER, + model.QosBaseRateLimiter_RESOURCE_TYPE_EGRESSRATELIMITER, +} + +var qosProfilePathExample = getMultitenancyPathExample("/infra/qos-profiles/[profile]") func resourceNsxtPolicyQosProfile() *schema.Resource { return &schema.Resource{ @@ -27,7 +34,7 @@ func resourceNsxtPolicyQosProfile() *schema.Resource { Update: resourceNsxtPolicyQosProfileUpdate, Delete: resourceNsxtPolicyQosProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(qosProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_qos_profile_test.go b/nsxt/resource_nsxt_policy_qos_profile_test.go index 43533278a..4ceeb629e 100644 --- a/nsxt/resource_nsxt_policy_qos_profile_test.go +++ b/nsxt/resource_nsxt_policy_qos_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_role.go b/nsxt/resource_nsxt_policy_role.go index 09f74de45..e92d8f2ce 100644 --- a/nsxt/resource_nsxt_policy_role.go +++ b/nsxt/resource_nsxt_policy_role.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_role_binding.go b/nsxt/resource_nsxt_policy_role_binding.go index 29fa888e4..a728faf4f 100644 --- a/nsxt/resource_nsxt_policy_role_binding.go +++ b/nsxt/resource_nsxt_policy_role_binding.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_role_binding_test.go b/nsxt/resource_nsxt_policy_role_binding_test.go index 4fd57dd4d..fd6684584 100644 --- a/nsxt/resource_nsxt_policy_role_binding_test.go +++ b/nsxt/resource_nsxt_policy_role_binding_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_role_test.go b/nsxt/resource_nsxt_policy_role_test.go index 3414d47dc..cce7e73dc 100644 --- a/nsxt/resource_nsxt_policy_role_test.go +++ b/nsxt/resource_nsxt_policy_role_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_security_policy.go b/nsxt/resource_nsxt_policy_security_policy.go index abdd4cb4d..d523bf55d 100644 --- a/nsxt/resource_nsxt_policy_security_policy.go +++ b/nsxt/resource_nsxt_policy_security_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_security_policy_rule.go b/nsxt/resource_nsxt_policy_security_policy_rule.go index 3751c5407..cfba54ddd 100644 --- a/nsxt/resource_nsxt_policy_security_policy_rule.go +++ b/nsxt/resource_nsxt_policy_security_policy_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. -SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_security_policy_rule_test.go b/nsxt/resource_nsxt_policy_security_policy_rule_test.go index 4899b5f47..f76c35c58 100644 --- a/nsxt/resource_nsxt_policy_security_policy_rule_test.go +++ b/nsxt/resource_nsxt_policy_security_policy_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_security_policy_test.go b/nsxt/resource_nsxt_policy_security_policy_test.go index eda796609..de28a5183 100644 --- a/nsxt/resource_nsxt_policy_security_policy_test.go +++ b/nsxt/resource_nsxt_policy_security_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -949,12 +950,12 @@ func testAccNsxtPolicySecurityPolicyWithIPCidrRange(name string, destIP string, locked = false stateful = true tcp_strict = false - + tag { scope = "color" tag = "orange" } - + rule { display_name = "rule1" source_groups = [nsxt_policy_group.group1.path] @@ -964,11 +965,11 @@ func testAccNsxtPolicySecurityPolicyWithIPCidrRange(name string, destIP string, } rule { - display_name = "rule2" - source_groups = [nsxt_policy_group.group1.path] - destination_groups = ["%s"] - services = [nsxt_policy_service.icmp.path] - action = "ALLOW" + display_name = "rule2" + source_groups = [nsxt_policy_group.group1.path] + destination_groups = ["%s"] + services = [nsxt_policy_service.icmp.path] + action = "ALLOW" } rule { @@ -986,7 +987,7 @@ func testAccNsxtPolicySecurityPolicyWithIPCidrRange(name string, destIP string, services = [nsxt_policy_service.icmp.path] action = "ALLOW" } - + rule { display_name = "rule5" source_groups = ["%s"] @@ -994,21 +995,21 @@ func testAccNsxtPolicySecurityPolicyWithIPCidrRange(name string, destIP string, services = [nsxt_policy_service.icmp.path] action = "ALLOW" sequence_number = 105 - } - + } + rule { display_name = "rule6" source_groups = ["%s"] destination_groups = [nsxt_policy_group.group2.path] service_entries { icmp_entry { - display_name = "test" - icmp_type = "3" - protocol = "ICMPv4" + display_name = "test" + icmp_type = "3" + protocol = "ICMPv4" } l4_port_set_entry { - protocol = "TCP" - destination_ports = ["8000-8080"] + protocol = "TCP" + destination_ports = ["8000-8080"] } } action = "ALLOW" diff --git a/nsxt/resource_nsxt_policy_segment.go b/nsxt/resource_nsxt_policy_segment.go index fab5bc612..4002bbd04 100644 --- a/nsxt/resource_nsxt_policy_segment.go +++ b/nsxt/resource_nsxt_policy_segment.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -7,6 +8,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) +var segmentPathExample = getMultitenancyPathExample("/infra/segments/[segment]") + func resourceNsxtPolicySegment() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicySegmentCreate, @@ -14,7 +17,7 @@ func resourceNsxtPolicySegment() *schema.Resource { Update: resourceNsxtPolicySegmentUpdate, Delete: resourceNsxtPolicySegmentDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(segmentPathExample), }, Schema: getPolicyCommonSegmentSchema(false, false), diff --git a/nsxt/resource_nsxt_policy_segment_security_profile.go b/nsxt/resource_nsxt_policy_segment_security_profile.go index f087a5ac0..8ddba558a 100644 --- a/nsxt/resource_nsxt_policy_segment_security_profile.go +++ b/nsxt/resource_nsxt_policy_segment_security_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -237,6 +238,8 @@ var segmentSecurityProfileSchema = map[string]*metadata.ExtendedSchema{ }, } +var segmentSecurityProfilePathExample = getMultitenancyPathExample("/infra/segment-security-profiles/[profile]") + func resourceNsxtPolicySegmentSecurityProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicySegmentSecurityProfileCreate, @@ -244,7 +247,7 @@ func resourceNsxtPolicySegmentSecurityProfile() *schema.Resource { Update: resourceNsxtPolicySegmentSecurityProfileUpdate, Delete: resourceNsxtPolicySegmentSecurityProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(segmentSecurityProfilePathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(segmentSecurityProfileSchema), diff --git a/nsxt/resource_nsxt_policy_segment_security_profile_test.go b/nsxt/resource_nsxt_policy_segment_security_profile_test.go index c5c37ed26..3a17b50ae 100644 --- a/nsxt/resource_nsxt_policy_segment_security_profile_test.go +++ b/nsxt/resource_nsxt_policy_segment_security_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_service.go b/nsxt/resource_nsxt_policy_service.go index 7fdbcd4f8..3f4f92a28 100644 --- a/nsxt/resource_nsxt_policy_service.go +++ b/nsxt/resource_nsxt_policy_service.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -198,6 +199,8 @@ func getNestedServiceEntrySchema() *schema.Schema { } } +var servicePathExample = getMultitenancyPathExample("/infra/services/[service]") + func resourceNsxtPolicyService() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyServiceCreate, @@ -205,7 +208,7 @@ func resourceNsxtPolicyService() *schema.Resource { Update: resourceNsxtPolicyServiceUpdate, Delete: resourceNsxtPolicyServiceDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(servicePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_service_test.go b/nsxt/resource_nsxt_policy_service_test.go index 91db8e318..6e0148709 100644 --- a/nsxt/resource_nsxt_policy_service_test.go +++ b/nsxt/resource_nsxt_policy_service_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_share.go b/nsxt/resource_nsxt_policy_share.go index 3f0456757..74c8cf9c8 100644 --- a/nsxt/resource_nsxt_policy_share.go +++ b/nsxt/resource_nsxt_policy_share.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -19,6 +20,8 @@ var sharingStrategyVals = []string{ model.Share_SHARING_STRATEGY_NONE_DESCENDANTS, } +var sharePathExample = getMultitenancyPathExample("/infra/shares/[share]") + func resourceNsxtPolicyShare() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyShareCreate, @@ -26,7 +29,7 @@ func resourceNsxtPolicyShare() *schema.Resource { Update: resourceNsxtPolicyShareUpdate, Delete: resourceNsxtPolicyShareDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(sharePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_share_test.go b/nsxt/resource_nsxt_policy_share_test.go index bedff8915..7f61e3db5 100644 --- a/nsxt/resource_nsxt_policy_share_test.go +++ b/nsxt/resource_nsxt_policy_share_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_shared_resource.go b/nsxt/resource_nsxt_policy_shared_resource.go index 1b357d660..df09e2240 100644 --- a/nsxt/resource_nsxt_policy_shared_resource.go +++ b/nsxt/resource_nsxt_policy_shared_resource.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_shared_resource_test.go b/nsxt/resource_nsxt_policy_shared_resource_test.go index cc73fa004..0a2ed7bad 100644 --- a/nsxt/resource_nsxt_policy_shared_resource_test.go +++ b/nsxt/resource_nsxt_policy_shared_resource_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -200,7 +201,7 @@ func testAccNsxtPolicySharedResourceTemplate(createFlow bool) string { resource "nsxt_policy_shared_resource" "test" { display_name = "%s" description = "%s" - + share_path = nsxt_policy_share.test.path resource_object { resource_path = data.nsxt_policy_context_profile.test.path diff --git a/nsxt/resource_nsxt_policy_site.go b/nsxt/resource_nsxt_policy_site.go index c3607e0c7..8901478da 100644 --- a/nsxt/resource_nsxt_policy_site.go +++ b/nsxt/resource_nsxt_policy_site.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -18,6 +19,8 @@ var siteTypeValues = []string{ gm_model.Site_SITE_TYPE_SDDC_LM, } +var sitePathExample = "/infra/sites/[site]" + func resourceNsxtPolicySite() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicySiteCreate, @@ -25,7 +28,7 @@ func resourceNsxtPolicySite() *schema.Resource { Update: resourceNsxtPolicySiteUpdate, Delete: resourceNsxtPolicySiteDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(sitePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_spoof_guard_profile.go b/nsxt/resource_nsxt_policy_spoof_guard_profile.go index 0d38145fb..3b579b3ed 100644 --- a/nsxt/resource_nsxt_policy_spoof_guard_profile.go +++ b/nsxt/resource_nsxt_policy_spoof_guard_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var spoofGuardProfilePathExample = getMultitenancyPathExample("/infra/spoofguard-profiles/[profile]") + func resourceNsxtPolicySpoofGuardProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicySpoofGuardProfileCreate, @@ -22,7 +25,7 @@ func resourceNsxtPolicySpoofGuardProfile() *schema.Resource { Update: resourceNsxtPolicySpoofGuardProfileUpdate, Delete: resourceNsxtPolicySpoofGuardProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(spoofGuardProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_spoof_guard_profile_test.go b/nsxt/resource_nsxt_policy_spoof_guard_profile_test.go index 1821c5353..cfb1a973c 100644 --- a/nsxt/resource_nsxt_policy_spoof_guard_profile_test.go +++ b/nsxt/resource_nsxt_policy_spoof_guard_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_static_route.go b/nsxt/resource_nsxt_policy_static_route.go index fb49791e1..0d7e1c64d 100644 --- a/nsxt/resource_nsxt_policy_static_route.go +++ b/nsxt/resource_nsxt_policy_static_route.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_static_route_bfd_peer.go b/nsxt/resource_nsxt_policy_static_route_bfd_peer.go index a8725811f..cfaaef754 100644 --- a/nsxt/resource_nsxt_policy_static_route_bfd_peer.go +++ b/nsxt/resource_nsxt_policy_static_route_bfd_peer.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_static_route_bfd_peer_test.go b/nsxt/resource_nsxt_policy_static_route_bfd_peer_test.go index 6bff0d73d..2f9ac82d1 100644 --- a/nsxt/resource_nsxt_policy_static_route_bfd_peer_test.go +++ b/nsxt/resource_nsxt_policy_static_route_bfd_peer_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_static_route_test.go b/nsxt/resource_nsxt_policy_static_route_test.go index 69d536856..4496d3175 100644 --- a/nsxt/resource_nsxt_policy_static_route_test.go +++ b/nsxt/resource_nsxt_policy_static_route_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway.go b/nsxt/resource_nsxt_policy_tier0_gateway.go index 66eaa82e1..50ddf5760 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go index 4be8a1e5f..f4aa09012 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_gm_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel.go b/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel.go index 8a34c05f7..0f51baebc 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel_test.go index cebab87e1..e3820b2d7 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_gre_tunnel_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config.go b/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config.go index b41d6d611..f89a3b859 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config_test.go index 122dee01a..b119d4a8a 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_ha_vip_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_interface.go b/nsxt/resource_nsxt_policy_tier0_gateway_interface.go index b15f05942..6ef243bca 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_interface.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_interface.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go index 040533004..0a6cbb48c 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_interface_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_gateway_test.go b/nsxt/resource_nsxt_policy_tier0_gateway_test.go index a41f8dfa7..0800dc3ce 100644 --- a/nsxt/resource_nsxt_policy_tier0_gateway_test.go +++ b/nsxt/resource_nsxt_policy_tier0_gateway_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing.go b/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing.go index 7d497d1f1..e6e1c5ea6 100644 --- a/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing.go +++ b/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing_test.go b/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing_test.go index a200a4f4e..6f74473c5 100644 --- a/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing_test.go +++ b/nsxt/resource_nsxt_policy_tier0_inter_vrf_routing_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier1_gateway.go b/nsxt/resource_nsxt_policy_tier1_gateway.go index 160f8db41..24ed17b38 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -55,6 +56,8 @@ var t1TypeValues = []string{ model.Tier1_TYPE_NATTED, } +var tier1GatewayPathExample = getMultitenancyPathExample("/infra/tier-1s/[gateway]") + func resourceNsxtPolicyTier1Gateway() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyTier1GatewayCreate, @@ -62,7 +65,7 @@ func resourceNsxtPolicyTier1Gateway() *schema.Resource { Update: resourceNsxtPolicyTier1GatewayUpdate, Delete: resourceNsxtPolicyTier1GatewayDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(tier1GatewayPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go index 93ba8b071..6c5516319 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_gm_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_interface.go b/nsxt/resource_nsxt_policy_tier1_gateway_interface.go index 5c4a00b1a..8c33e0f25 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_interface.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_interface.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go index 511b8ee08..208c0dd58 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_interface_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_tier1_gateway_test.go b/nsxt/resource_nsxt_policy_tier1_gateway_test.go index b6f347c9a..eb18d15d9 100644 --- a/nsxt/resource_nsxt_policy_tier1_gateway_test.go +++ b/nsxt/resource_nsxt_policy_tier1_gateway_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_transit_gateway.go b/nsxt/resource_nsxt_policy_transit_gateway.go index 8d98efbf9..9fcb4fc99 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway.go +++ b/nsxt/resource_nsxt_policy_transit_gateway.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -54,7 +55,7 @@ func resourceNsxtPolicyTransitGateway() *schema.Resource { Update: resourceNsxtPolicyTransitGatewayUpdate, Delete: resourceNsxtPolicyTransitGatewayDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(transitGatewayPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(transitGatewaySchema), } diff --git a/nsxt/resource_nsxt_policy_transit_gateway_attachment.go b/nsxt/resource_nsxt_policy_transit_gateway_attachment.go index 4bb27b353..521a938ae 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway_attachment.go +++ b/nsxt/resource_nsxt_policy_transit_gateway_attachment.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -54,7 +55,7 @@ func resourceNsxtPolicyTransitGatewayAttachment() *schema.Resource { func resourceNsxtPolicyTransitGatewayAttachmentExists(sessionContext utl.SessionContext, parentPath string, id string, connector client.Connector) (bool, error) { var err error - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return false, pathErr } @@ -80,7 +81,7 @@ func resourceNsxtPolicyTransitGatewayAttachmentCreate(d *schema.ResourceData, m } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return pathErr } @@ -122,7 +123,7 @@ func resourceNsxtPolicyTransitGatewayAttachmentRead(d *schema.ResourceData, m in client := clientLayer.NewAttachmentsClient(connector) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return pathErr } @@ -152,7 +153,7 @@ func resourceNsxtPolicyTransitGatewayAttachmentUpdate(d *schema.ResourceData, m } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return pathErr } @@ -190,7 +191,7 @@ func resourceNsxtPolicyTransitGatewayAttachmentDelete(d *schema.ResourceData, m connector := getPolicyConnector(m) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, transitGatewayPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_policy_transit_gateway_attachment_test.go b/nsxt/resource_nsxt_policy_transit_gateway_attachment_test.go index 7b5ebb52d..49ffd0849 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway_attachment_test.go +++ b/nsxt/resource_nsxt_policy_transit_gateway_attachment_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_transit_gateway_nat_rule.go b/nsxt/resource_nsxt_policy_transit_gateway_nat_rule.go index d8a2e7b35..d6fa0b7e1 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway_nat_rule.go +++ b/nsxt/resource_nsxt_policy_transit_gateway_nat_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -17,6 +18,8 @@ import ( "github.com/vmware/terraform-provider-nsxt/nsxt/metadata" ) +var transitGatewayNatPathExample = "/orgs/[org]/projects/[project]/transit-gateways/[gateway]/nat/[type]" + func resourceNsxtPolicyTransitGatewayNatRule() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyTransitGatewayNatRuleCreate, @@ -34,7 +37,7 @@ func resourceNsxtPolicyTransitGatewayNatRule() *schema.Resource { func resourceNsxtPolicyTransitGatewayNatRuleExists(sessionContext utl.SessionContext, parentPath string, id string, connector client.Connector) (bool, error) { var err error - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, transitGatewayNatPathExample) if pathErr != nil { return false, pathErr } @@ -60,7 +63,7 @@ func resourceNsxtPolicyTransitGatewayNatRuleCreate(d *schema.ResourceData, m int } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, transitGatewayNatPathExample) if pathErr != nil { return pathErr } @@ -102,7 +105,7 @@ func resourceNsxtPolicyTransitGatewayNatRuleRead(d *schema.ResourceData, m inter client := clientLayer.NewNatRulesClient(connector) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, transitGatewayNatPathExample) if pathErr != nil { return pathErr } @@ -132,7 +135,7 @@ func resourceNsxtPolicyTransitGatewayNatRuleUpdate(d *schema.ResourceData, m int } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, transitGatewayNatPathExample) if pathErr != nil { return pathErr } @@ -170,7 +173,7 @@ func resourceNsxtPolicyTransitGatewayNatRuleDelete(d *schema.ResourceData, m int connector := getPolicyConnector(m) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, transitGatewayNatPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_policy_transit_gateway_nat_rule_test.go b/nsxt/resource_nsxt_policy_transit_gateway_nat_rule_test.go index da00b1b5a..269d78f07 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway_nat_rule_test.go +++ b/nsxt/resource_nsxt_policy_transit_gateway_nat_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_transit_gateway_test.go b/nsxt/resource_nsxt_policy_transit_gateway_test.go index c50f950c5..a50750aba 100644 --- a/nsxt/resource_nsxt_policy_transit_gateway_test.go +++ b/nsxt/resource_nsxt_policy_transit_gateway_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_transport_zone.go b/nsxt/resource_nsxt_policy_transport_zone.go index 50758be90..16e8fb201 100644 --- a/nsxt/resource_nsxt_policy_transport_zone.go +++ b/nsxt/resource_nsxt_policy_transport_zone.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_transport_zone_test.go b/nsxt/resource_nsxt_policy_transport_zone_test.go index aa7589433..1b5c549d3 100644 --- a/nsxt/resource_nsxt_policy_transport_zone_test.go +++ b/nsxt/resource_nsxt_policy_transport_zone_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_uplink_host_switch_profile.go b/nsxt/resource_nsxt_policy_uplink_host_switch_profile.go index 76ce91eef..18e2618d0 100644 --- a/nsxt/resource_nsxt_policy_uplink_host_switch_profile.go +++ b/nsxt/resource_nsxt_policy_uplink_host_switch_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -49,6 +50,8 @@ var overlayEncapModes = []string{ model.PolicyUplinkHostSwitchProfile_OVERLAY_ENCAP_GENEVE, } +var uplinkHostSwitchProfilePathSample = "/infra/host-switch-profiles/[profile]" + func resourceNsxtUplinkHostSwitchProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtUplinkHostSwitchProfileCreate, @@ -56,7 +59,7 @@ func resourceNsxtUplinkHostSwitchProfile() *schema.Resource { Update: resourceNsxtUplinkHostSwitchProfileUpdate, Delete: resourceNsxtUplinkHostSwitchProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(uplinkHostSwitchProfilePathSample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go b/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go index 1813fc1f1..5d84b7767 100644 --- a/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go +++ b/nsxt/resource_nsxt_policy_uplink_host_switch_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -321,6 +322,6 @@ resource "nsxt_policy_uplink_host_switch_profile" "test" { uplink_type = "%s" } policy = "%s" - } + } }`, accTestUplinkHostSwitchProfileUpdateAttributes["display_name"], accTestUplinkHostSwitchProfileUpdateAttributes["teaming_al_uplink_name"], accTestUplinkHostSwitchProfileUpdateAttributes["teaming_al_uplink_type"], accTestUplinkHostSwitchProfileUpdateAttributes["teaming_policy"]) } diff --git a/nsxt/resource_nsxt_policy_vlan_segment.go b/nsxt/resource_nsxt_policy_vlan_segment.go index 884bd7ef8..a0b93fb8d 100644 --- a/nsxt/resource_nsxt_policy_vlan_segment.go +++ b/nsxt/resource_nsxt_policy_vlan_segment.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -18,7 +19,7 @@ func resourceNsxtPolicyVlanSegment() *schema.Resource { Update: resourceNsxtPolicyVlanSegmentUpdate, Delete: resourceNsxtPolicyVlanSegmentDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(segmentPathExample), }, Schema: segSchema, diff --git a/nsxt/resource_nsxt_policy_vlan_segment_test.go b/nsxt/resource_nsxt_policy_vlan_segment_test.go index bd8c67b11..30c027988 100644 --- a/nsxt/resource_nsxt_policy_vlan_segment_test.go +++ b/nsxt/resource_nsxt_policy_vlan_segment_test.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/resource_nsxt_policy_vm_tags.go b/nsxt/resource_nsxt_policy_vm_tags.go index e82097596..7ac728019 100644 --- a/nsxt/resource_nsxt_policy_vm_tags.go +++ b/nsxt/resource_nsxt_policy_vm_tags.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -29,6 +30,8 @@ var ( nsxtPolicyInstanceUUIDKey = "instanceUuid" ) +var vmTagsPathExample = getMultitenancyPathExample("/infra/realized-state/virtual-machines/[vm]") + func resourceNsxtPolicyVMTags() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyVMTagsCreate, @@ -36,7 +39,7 @@ func resourceNsxtPolicyVMTags() *schema.Resource { Update: resourceNsxtPolicyVMTagsUpdate, Delete: resourceNsxtPolicyVMTagsDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(vmTagsPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_vm_tags_test.go b/nsxt/resource_nsxt_policy_vm_tags_test.go index 4d3076e07..9be86fa0a 100644 --- a/nsxt/resource_nsxt_policy_vm_tags_test.go +++ b/nsxt/resource_nsxt_policy_vm_tags_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_vni_pool.go b/nsxt/resource_nsxt_policy_vni_pool.go index eafa4c2b8..91125ecfa 100644 --- a/nsxt/resource_nsxt_policy_vni_pool.go +++ b/nsxt/resource_nsxt_policy_vni_pool.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -14,6 +15,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" ) +var vniPoolPathExample = "/infra/vni-pools/[pool]" + func resourceNsxtPolicyVniPool() *schema.Resource { return &schema.Resource{ Create: resourceNsxtPolicyVniPoolCreate, @@ -21,7 +24,7 @@ func resourceNsxtPolicyVniPool() *schema.Resource { Update: resourceNsxtPolicyVniPoolUpdate, Delete: resourceNsxtPolicyVniPoolDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(vniPoolPathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_vni_pool_test.go b/nsxt/resource_nsxt_policy_vni_pool_test.go index 5898dcc9f..6c8e3f1b0 100644 --- a/nsxt/resource_nsxt_policy_vni_pool_test.go +++ b/nsxt/resource_nsxt_policy_vni_pool_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile.go b/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile.go index 168c953e6..060ba5475 100644 --- a/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile.go +++ b/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model" ) +var vtepHAHostSwitchProfilePathExample = "/infra/host-switch-profiles/[profile]" + func resourceNsxtVtepHAHostSwitchProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVtepHAHostSwitchProfileCreate, @@ -22,7 +25,7 @@ func resourceNsxtVtepHAHostSwitchProfile() *schema.Resource { Update: resourceNsxtVtepHAHostSwitchProfileUpdate, Delete: resourceNsxtVtepHAHostSwitchProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathResourceImporter, + State: getPolicyPathOrIDResourceImporter(vtepHAHostSwitchProfilePathExample), }, Schema: map[string]*schema.Schema{ diff --git a/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile_test.go b/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile_test.go index 39a5cf814..4344327d5 100644 --- a/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile_test.go +++ b/nsxt/resource_nsxt_policy_vtep_ha_host_switch_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_principal_identity.go b/nsxt/resource_nsxt_principal_identity.go index 54d5d4f96..8d9019552 100644 --- a/nsxt/resource_nsxt_principal_identity.go +++ b/nsxt/resource_nsxt_principal_identity.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_principal_identity_test.go b/nsxt/resource_nsxt_principal_identity_test.go index 6dfc70996..5ecd09ba0 100644 --- a/nsxt/resource_nsxt_principal_identity_test.go +++ b/nsxt/resource_nsxt_principal_identity_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_qos_switching_profile.go b/nsxt/resource_nsxt_qos_switching_profile.go index 567c9898b..cb74dba75 100644 --- a/nsxt/resource_nsxt_qos_switching_profile.go +++ b/nsxt/resource_nsxt_qos_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_qos_switching_profile_test.go b/nsxt/resource_nsxt_qos_switching_profile_test.go index f6e9a9790..21446d03c 100644 --- a/nsxt/resource_nsxt_qos_switching_profile_test.go +++ b/nsxt/resource_nsxt_qos_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_spoofguard_switching_profile.go b/nsxt/resource_nsxt_spoofguard_switching_profile.go index 9d4589982..846bde439 100644 --- a/nsxt/resource_nsxt_spoofguard_switching_profile.go +++ b/nsxt/resource_nsxt_spoofguard_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_spoofguard_switching_profile_test.go b/nsxt/resource_nsxt_spoofguard_switching_profile_test.go index f2ae7941e..14d10d149 100644 --- a/nsxt/resource_nsxt_spoofguard_switching_profile_test.go +++ b/nsxt/resource_nsxt_spoofguard_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_static_route.go b/nsxt/resource_nsxt_static_route.go index 1a3ab9069..2445aec3c 100644 --- a/nsxt/resource_nsxt_static_route.go +++ b/nsxt/resource_nsxt_static_route.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_static_route_test.go b/nsxt/resource_nsxt_static_route_test.go index dd3963a77..1c1fafc50 100644 --- a/nsxt/resource_nsxt_static_route_test.go +++ b/nsxt/resource_nsxt_static_route_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_switch_security_switching_profile.go b/nsxt/resource_nsxt_switch_security_switching_profile.go index 8ccc2c16b..194bd15e7 100644 --- a/nsxt/resource_nsxt_switch_security_switching_profile.go +++ b/nsxt/resource_nsxt_switch_security_switching_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_switch_security_switching_profile_test.go b/nsxt/resource_nsxt_switch_security_switching_profile_test.go index 6a495e83a..9fbd1288f 100644 --- a/nsxt/resource_nsxt_switch_security_switching_profile_test.go +++ b/nsxt/resource_nsxt_switch_security_switching_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_upgrade_precheck_acknowledge.go b/nsxt/resource_nsxt_upgrade_precheck_acknowledge.go index 8a62501d2..44e93f26d 100644 --- a/nsxt/resource_nsxt_upgrade_precheck_acknowledge.go +++ b/nsxt/resource_nsxt_upgrade_precheck_acknowledge.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_upgrade_prepare.go b/nsxt/resource_nsxt_upgrade_prepare.go index 54ea5979f..fa8e3367c 100644 --- a/nsxt/resource_nsxt_upgrade_prepare.go +++ b/nsxt/resource_nsxt_upgrade_prepare.go @@ -1,5 +1,6 @@ -/* Copyright © 2023 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_upgrade_run.go b/nsxt/resource_nsxt_upgrade_run.go index a291f895e..66539ead5 100644 --- a/nsxt/resource_nsxt_upgrade_run.go +++ b/nsxt/resource_nsxt_upgrade_run.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vlan_logical_switch.go b/nsxt/resource_nsxt_vlan_logical_switch.go index e3396d96b..aecd3fd32 100644 --- a/nsxt/resource_nsxt_vlan_logical_switch.go +++ b/nsxt/resource_nsxt_vlan_logical_switch.go @@ -1,5 +1,6 @@ -/* Copyright © 2019 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vlan_logical_switch_test.go b/nsxt/resource_nsxt_vlan_logical_switch_test.go index 0131e091d..18457103a 100644 --- a/nsxt/resource_nsxt_vlan_logical_switch_test.go +++ b/nsxt/resource_nsxt_vlan_logical_switch_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vm_tags.go b/nsxt/resource_nsxt_vm_tags.go index 907f6e41b..f8a36d65d 100644 --- a/nsxt/resource_nsxt_vm_tags.go +++ b/nsxt/resource_nsxt_vm_tags.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/resource_nsxt_vm_tags_test.go b/nsxt/resource_nsxt_vm_tags_test.go index 2c44fb3cb..435f3b71a 100644 --- a/nsxt/resource_nsxt_vm_tags_test.go +++ b/nsxt/resource_nsxt_vm_tags_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc.go b/nsxt/resource_nsxt_vpc.go index 4ec4a70bd..4e0d110e7 100644 --- a/nsxt/resource_nsxt_vpc.go +++ b/nsxt/resource_nsxt_vpc.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_attachment.go b/nsxt/resource_nsxt_vpc_attachment.go index 6f373418f..ff03f6bc5 100644 --- a/nsxt/resource_nsxt_vpc_attachment.go +++ b/nsxt/resource_nsxt_vpc_attachment.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -17,6 +18,8 @@ import ( "github.com/vmware/terraform-provider-nsxt/nsxt/metadata" ) +var vpcPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]" + var vpcAttachmentSchema = map[string]*metadata.ExtendedSchema{ "nsx_id": metadata.GetExtendedSchema(getNsxIDSchema()), "path": metadata.GetExtendedSchema(getPathSchema()), @@ -53,7 +56,7 @@ func resourceNsxtVpcAttachment() *schema.Resource { func resourceNsxtVpcAttachmentExists(sessionContext utl.SessionContext, parentPath string, id string, connector client.Connector) (bool, error) { var err error - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, vpcPathExample) if pathErr != nil { return false, pathErr } @@ -79,7 +82,7 @@ func resourceNsxtVpcAttachmentCreate(d *schema.ResourceData, m interface{}) erro } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, vpcPathExample) if pathErr != nil { return pathErr } @@ -121,7 +124,7 @@ func resourceNsxtVpcAttachmentRead(d *schema.ResourceData, m interface{}) error client := clientLayer.NewAttachmentsClient(connector) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, vpcPathExample) if pathErr != nil { return pathErr } @@ -151,7 +154,7 @@ func resourceNsxtVpcAttachmentUpdate(d *schema.ResourceData, m interface{}) erro } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, vpcPathExample) if pathErr != nil { return pathErr } @@ -190,7 +193,7 @@ func resourceNsxtVpcAttachmentDelete(d *schema.ResourceData, m interface{}) erro connector := getPolicyConnector(m) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 3, vpcPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_vpc_connectivity_profile.go b/nsxt/resource_nsxt_vpc_connectivity_profile.go index 988819805..49f155d81 100644 --- a/nsxt/resource_nsxt_vpc_connectivity_profile.go +++ b/nsxt/resource_nsxt_vpc_connectivity_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -185,6 +186,8 @@ var vpcConnectivityProfileSchema = map[string]*metadata.ExtendedSchema{ }, } +var vpcConnectivityProfilePathExample = "/orgs/[org]/projects/[project]/vpc-connectivity-profiles/[profile]" + func resourceNsxtVpcConnectivityProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVpcConnectivityProfileCreate, @@ -192,7 +195,7 @@ func resourceNsxtVpcConnectivityProfile() *schema.Resource { Update: resourceNsxtVpcConnectivityProfileUpdate, Delete: resourceNsxtVpcConnectivityProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(vpcConnectivityProfilePathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(vpcConnectivityProfileSchema), } diff --git a/nsxt/resource_nsxt_vpc_connectivity_profile_test.go b/nsxt/resource_nsxt_vpc_connectivity_profile_test.go index 9bee4be6b..30906b057 100644 --- a/nsxt/resource_nsxt_vpc_connectivity_profile_test.go +++ b/nsxt/resource_nsxt_vpc_connectivity_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config.go b/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config.go index 1e7500f97..60c92cb3b 100644 --- a/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config.go +++ b/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -212,7 +213,7 @@ func resourceNsxtVpcSubnetDhcpV4StaticBindingConfig() *schema.Resource { func resourceNsxtVpcSubnetDhcpV4StaticBindingConfigExists(sessionContext utl.SessionContext, parentPath string, id string, connector client.Connector) (bool, error) { var err error - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcSubnetPathExample) if pathErr != nil { return false, pathErr } @@ -238,7 +239,7 @@ func resourceNsxtVpcSubnetDhcpV4StaticBindingConfigCreate(d *schema.ResourceData } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcSubnetPathExample) if pathErr != nil { return pathErr } @@ -287,7 +288,7 @@ func resourceNsxtVpcSubnetDhcpV4StaticBindingConfigRead(d *schema.ResourceData, client := clientLayer.NewDhcpStaticBindingConfigsClient(connector) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcSubnetPathExample) if pathErr != nil { return pathErr } @@ -327,7 +328,7 @@ func resourceNsxtVpcSubnetDhcpV4StaticBindingConfigUpdate(d *schema.ResourceData } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcSubnetPathExample) if pathErr != nil { return pathErr } @@ -376,7 +377,7 @@ func resourceNsxtVpcSubnetDhcpV4StaticBindingConfigDelete(d *schema.ResourceData connector := getPolicyConnector(m) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcSubnetPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config_test.go b/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config_test.go index 66fdf00ae..158c4dfd6 100644 --- a/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config_test.go +++ b/nsxt/resource_nsxt_vpc_dhcp_v4_static_binding_config_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_external_address.go b/nsxt/resource_nsxt_vpc_external_address.go index 20f674e70..45c09d16d 100644 --- a/nsxt/resource_nsxt_vpc_external_address.go +++ b/nsxt/resource_nsxt_vpc_external_address.go @@ -9,6 +9,8 @@ import ( "github.com/vmware/vsphere-automation-sdk-go/services/nsxt/orgs/projects/vpcs/subnets" ) +var vpcSubnetPortPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/subnets/[subnet]/ports/[port]" + func resourceNsxtVpcExternalAddress() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVpcExternalAddressCreate, @@ -35,7 +37,7 @@ func updatePort(d *schema.ResourceData, m interface{}, deleteFlow bool) error { addressPath := d.Get("allocated_external_ip_path").(string) log.Printf("[DEBUG] Updating external address binding for port %s", portPath) - parents, pathErr := parseStandardPolicyPathVerifySize(portPath, 5) + parents, pathErr := parseStandardPolicyPathVerifySize(portPath, 5, vpcSubnetPortPathExample) if pathErr != nil { return pathErr } @@ -73,7 +75,7 @@ func resourceNsxtVpcExternalAddressCreate(d *schema.ResourceData, m interface{}) func resourceNsxtVpcExternalAddressRead(d *schema.ResourceData, m interface{}) error { portPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(portPath, 5) + parents, pathErr := parseStandardPolicyPathVerifySize(portPath, 5, vpcSubnetPortPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_vpc_gateway_policy.go b/nsxt/resource_nsxt_vpc_gateway_policy.go index b2ee84ac1..cfa66c90b 100644 --- a/nsxt/resource_nsxt_vpc_gateway_policy.go +++ b/nsxt/resource_nsxt_vpc_gateway_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -15,6 +16,8 @@ import ( utl "github.com/vmware/terraform-provider-nsxt/api/utl" ) +var vpcGatewayPolicyPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/gateway-policies/[policy]" + func resourceNsxtVPCGatewayPolicy() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVPCGatewayPolicyCreate, @@ -22,7 +25,7 @@ func resourceNsxtVPCGatewayPolicy() *schema.Resource { Update: resourceNsxtVPCGatewayPolicyUpdate, Delete: resourceNsxtVPCGatewayPolicyDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcGatewayPolicyPathExample), }, Schema: getPolicyGatewayPolicySchema(true), diff --git a/nsxt/resource_nsxt_vpc_gateway_policy_test.go b/nsxt/resource_nsxt_vpc_gateway_policy_test.go index 04a078b32..2de2e5360 100644 --- a/nsxt/resource_nsxt_vpc_gateway_policy_test.go +++ b/nsxt/resource_nsxt_vpc_gateway_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_group.go b/nsxt/resource_nsxt_vpc_group.go index fc786f6f2..84332bb85 100644 --- a/nsxt/resource_nsxt_vpc_group.go +++ b/nsxt/resource_nsxt_vpc_group.go @@ -1,10 +1,13 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt import "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +var vpcGroupPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/groups/[group]" + func resourceNsxtVPCGroup() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVPCGroupCreate, @@ -12,7 +15,7 @@ func resourceNsxtVPCGroup() *schema.Resource { Update: resourceNsxtVPCGroupUpdate, Delete: resourceNsxtVPCGroupDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcGroupPathExample), }, Schema: getPolicyGroupSchema(false), diff --git a/nsxt/resource_nsxt_vpc_group_test.go b/nsxt/resource_nsxt_vpc_group_test.go index 9a0a2b0c3..20eddd212 100644 --- a/nsxt/resource_nsxt_vpc_group_test.go +++ b/nsxt/resource_nsxt_vpc_group_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_ip_address_allocation.go b/nsxt/resource_nsxt_vpc_ip_address_allocation.go index 4dc9b836b..843018d40 100644 --- a/nsxt/resource_nsxt_vpc_ip_address_allocation.go +++ b/nsxt/resource_nsxt_vpc_ip_address_allocation.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -99,6 +100,8 @@ var vpcIpAddressAllocationSchema = map[string]*metadata.ExtendedSchema{ }, } +var vpcIpAddressAllocationPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/ip-address-allocations/[allocation]" + func resourceNsxtVpcIpAddressAllocation() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVpcIpAddressAllocationCreate, @@ -106,7 +109,7 @@ func resourceNsxtVpcIpAddressAllocation() *schema.Resource { Update: resourceNsxtVpcIpAddressAllocationUpdate, Delete: resourceNsxtVpcIpAddressAllocationDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcIpAddressAllocationPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(vpcIpAddressAllocationSchema), } diff --git a/nsxt/resource_nsxt_vpc_ip_address_allocation_test.go b/nsxt/resource_nsxt_vpc_ip_address_allocation_test.go index a009a7b74..327f7ff91 100644 --- a/nsxt/resource_nsxt_vpc_ip_address_allocation_test.go +++ b/nsxt/resource_nsxt_vpc_ip_address_allocation_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_nat_rule.go b/nsxt/resource_nsxt_vpc_nat_rule.go index 276183ae5..253c74c04 100644 --- a/nsxt/resource_nsxt_vpc_nat_rule.go +++ b/nsxt/resource_nsxt_vpc_nat_rule.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -30,6 +31,8 @@ var policyVpcNatRuleFirewallMatchValues = []string{ model.PolicyVpcNatRule_FIREWALL_MATCH_BYPASS, } +var vpcNatPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/nat/[type]" + var policyVpcNatRuleSchema = map[string]*metadata.ExtendedSchema{ "nsx_id": metadata.GetExtendedSchema(getNsxIDSchema()), "path": metadata.GetExtendedSchema(getPathSchema()), @@ -144,7 +147,7 @@ func resourceNsxtPolicyVpcNatRule() *schema.Resource { func resourceNsxtPolicyVpcNatRuleExists(sessionContext utl.SessionContext, parentPath string, id string, connector client.Connector) (bool, error) { var err error - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcNatPathExample) if pathErr != nil { return false, pathErr } @@ -170,7 +173,7 @@ func resourceNsxtPolicyVpcNatRuleCreate(d *schema.ResourceData, m interface{}) e } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcNatPathExample) if pathErr != nil { return pathErr } @@ -212,7 +215,7 @@ func resourceNsxtPolicyVpcNatRuleRead(d *schema.ResourceData, m interface{}) err client := clientLayer.NewNatRulesClient(connector) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcNatPathExample) if pathErr != nil { return pathErr } @@ -242,7 +245,7 @@ func resourceNsxtPolicyVpcNatRuleUpdate(d *schema.ResourceData, m interface{}) e } parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcNatPathExample) if pathErr != nil { return pathErr } @@ -283,7 +286,7 @@ func resourceNsxtPolicyVpcNatRuleDelete(d *schema.ResourceData, m interface{}) e connector := getPolicyConnector(m) parentPath := d.Get("parent_path").(string) - parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4) + parents, pathErr := parseStandardPolicyPathVerifySize(parentPath, 4, vpcNatPathExample) if pathErr != nil { return pathErr } diff --git a/nsxt/resource_nsxt_vpc_nat_rule_test.go b/nsxt/resource_nsxt_vpc_nat_rule_test.go index 66bdc3e41..dfdfcd596 100644 --- a/nsxt/resource_nsxt_vpc_nat_rule_test.go +++ b/nsxt/resource_nsxt_vpc_nat_rule_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_security_policy.go b/nsxt/resource_nsxt_vpc_security_policy.go index afbbb528b..49f16be41 100644 --- a/nsxt/resource_nsxt_vpc_security_policy.go +++ b/nsxt/resource_nsxt_vpc_security_policy.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -11,6 +12,8 @@ import ( "github.com/vmware/terraform-provider-nsxt/api/infra/domains" ) +var vpcSecurityPolicyPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/security-policies/[security-policy]" + func resourceNsxtVPCSecurityPolicy() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVPCSecurityPolicyCreate, @@ -18,7 +21,7 @@ func resourceNsxtVPCSecurityPolicy() *schema.Resource { Update: resourceNsxtVPCSecurityPolicyUpdate, Delete: resourceNsxtVPCSecurityPolicyDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcSecurityPolicyPathExample), }, Schema: getPolicySecurityPolicySchema(false, true, true, true), } diff --git a/nsxt/resource_nsxt_vpc_security_policy_test.go b/nsxt/resource_nsxt_vpc_security_policy_test.go index 0201ddca7..79f02e40b 100644 --- a/nsxt/resource_nsxt_vpc_security_policy_test.go +++ b/nsxt/resource_nsxt_vpc_security_policy_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_service_profile.go b/nsxt/resource_nsxt_vpc_service_profile.go index 5e8547b84..b3f6a2ee3 100644 --- a/nsxt/resource_nsxt_vpc_service_profile.go +++ b/nsxt/resource_nsxt_vpc_service_profile.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -240,6 +241,8 @@ var vpcServiceProfileSchema = map[string]*metadata.ExtendedSchema{ }, } +var vpcServiceProfilePathExample = "/orgs/[org]/projects/[project]/vpc-service-profiles/[profile]" + func resourceNsxtVpcServiceProfile() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVpcServiceProfileCreate, @@ -247,7 +250,7 @@ func resourceNsxtVpcServiceProfile() *schema.Resource { Update: resourceNsxtVpcServiceProfileUpdate, Delete: resourceNsxtVpcServiceProfileDelete, Importer: &schema.ResourceImporter{ - State: nsxtPolicyPathOnlyResourceImporter, + State: getPolicyPathResourceImporter(vpcServiceProfilePathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(vpcServiceProfileSchema), } diff --git a/nsxt/resource_nsxt_vpc_service_profile_test.go b/nsxt/resource_nsxt_vpc_service_profile_test.go index 9cdb16268..3fe4019b7 100644 --- a/nsxt/resource_nsxt_vpc_service_profile_test.go +++ b/nsxt/resource_nsxt_vpc_service_profile_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_static_routes.go b/nsxt/resource_nsxt_vpc_static_routes.go index 9c4ab2d28..3897bfa1d 100644 --- a/nsxt/resource_nsxt_vpc_static_routes.go +++ b/nsxt/resource_nsxt_vpc_static_routes.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -75,6 +76,8 @@ var staticRoutesSchema = map[string]*metadata.ExtendedSchema{ }, } +var vpcStaticRoutesPathExample = "/orgs/[org]/projects/[project]/vpcs/[vpc]/static-routes/[route]" + func resourceNsxtVpcStaticRoutes() *schema.Resource { return &schema.Resource{ Create: resourceNsxtVpcStaticRoutesCreate, @@ -82,7 +85,7 @@ func resourceNsxtVpcStaticRoutes() *schema.Resource { Update: resourceNsxtVpcStaticRoutesUpdate, Delete: resourceNsxtVpcStaticRoutesDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcStaticRoutesPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(staticRoutesSchema), } diff --git a/nsxt/resource_nsxt_vpc_static_routes_test.go b/nsxt/resource_nsxt_vpc_static_routes_test.go index 626786d90..ea0d16925 100644 --- a/nsxt/resource_nsxt_vpc_static_routes_test.go +++ b/nsxt/resource_nsxt_vpc_static_routes_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/resource_nsxt_vpc_subnet.go b/nsxt/resource_nsxt_vpc_subnet.go index 90517a369..3ecf2453c 100644 --- a/nsxt/resource_nsxt_vpc_subnet.go +++ b/nsxt/resource_nsxt_vpc_subnet.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -447,7 +448,7 @@ func resourceNsxtVpcSubnet() *schema.Resource { Update: resourceNsxtVpcSubnetUpdate, Delete: resourceNsxtVpcSubnetDelete, Importer: &schema.ResourceImporter{ - State: nsxtVPCPathResourceImporter, + State: getVpcPathResourceImporter(vpcSubnetPathExample), }, Schema: metadata.GetSchemaFromExtendedSchema(vpcSubnetSchema), } diff --git a/nsxt/resource_nsxt_vpc_subnet_test.go b/nsxt/resource_nsxt_vpc_subnet_test.go index 2f5795341..907770d7d 100644 --- a/nsxt/resource_nsxt_vpc_subnet_test.go +++ b/nsxt/resource_nsxt_vpc_subnet_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt @@ -31,6 +32,16 @@ var accTestVpcSubnetUpdateAttributes = map[string]string{ "reserved_ip_ranges": "11.11.50.4-11.11.50.6", } +var accTestVpcSubnetReservedIPRangeAttributes = map[string]string{ + "display_name": getAccTestResourceName(), + "description": "terraform created", + "access_mode": "Isolated", + "enabled": "true", + "ipv4_subnet_size": "32", + "ip_addresses": "10.110.1.0/26", + "reserved_ip_ranges": "10.110.1.3-10.110.1.15", +} + func TestAccResourceNsxtVpcSubnet_basic(t *testing.T) { testResourceName := "nsxt_vpc_subnet.test" @@ -116,8 +127,6 @@ func TestAccResourceNsxtVpcSubnet_subnetSize(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "ip_addresses.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.#", "1"), - resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.#", "1"), - resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.0", accTestVpcSubnetCreateAttributes["reserved_ip_ranges"]), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.option121.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.other.#", "1"), @@ -138,8 +147,6 @@ func TestAccResourceNsxtVpcSubnet_subnetSize(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "ipv4_subnet_size", accTestVpcSubnetCreateAttributes["ipv4_subnet_size"]), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.#", "1"), - resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.#", "1"), - resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.0", accTestVpcSubnetUpdateAttributes["reserved_ip_ranges"]), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.option121.#", "1"), resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.other.#", "1"), @@ -166,6 +173,44 @@ func TestAccResourceNsxtVpcSubnet_subnetSize(t *testing.T) { }) } +func TestAccResourceNsxtVpcSubnet_reservedIPRange(t *testing.T) { + testResourceName := "nsxt_vpc_subnet.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOnlyVPC(t) + }, + Providers: testAccProviders, + CheckDestroy: func(state *terraform.State) error { + return testAccNsxtVpcSubnetCheckDestroy(state, accTestVpcSubnetUpdateAttributes["display_name"]) + }, + Steps: []resource.TestStep{ + { + Config: testAccNsxtVpcSubnetReservedIPRangeTemplate(true), + Check: resource.ComposeTestCheckFunc( + testAccNsxtVpcSubnetExists(accTestVpcSubnetCreateAttributes["display_name"], testResourceName), + resource.TestCheckResourceAttr(testResourceName, "display_name", accTestVpcSubnetReservedIPRangeAttributes["display_name"]), + resource.TestCheckResourceAttr(testResourceName, "description", accTestVpcSubnetReservedIPRangeAttributes["description"]), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.reserved_ip_ranges.0", accTestVpcSubnetReservedIPRangeAttributes["reserved_ip_ranges"]), + resource.TestCheckResourceAttr(testResourceName, "ip_addresses.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.option121.#", "1"), + resource.TestCheckResourceAttr(testResourceName, "dhcp_config.0.dhcp_server_additional_config.0.options.0.other.#", "1"), + + resource.TestCheckResourceAttrSet(testResourceName, "nsx_id"), + resource.TestCheckResourceAttrSet(testResourceName, "path"), + resource.TestCheckResourceAttrSet(testResourceName, "revision"), + resource.TestCheckResourceAttr(testResourceName, "tag.#", "0"), + ), + }, + }, + }) +} + func TestAccResourceNsxtVpcSubnet_importBasic(t *testing.T) { name := getAccTestResourceName() testResourceName := "nsxt_vpc_subnet.test" @@ -301,10 +346,9 @@ resource "nsxt_vpc_subnet" "test" { values = ["abc", "def"] } } - reserved_ip_ranges = ["%s"] } } -}`, testAccNsxtPolicyMultitenancyContext(), attrMap["display_name"], attrMap["description"], attrMap["ipv4_subnet_size"], attrMap["reserved_ip_ranges"]) +}`, testAccNsxtPolicyMultitenancyContext(), attrMap["display_name"], attrMap["description"], attrMap["ipv4_subnet_size"]) } func testAccNsxtVpcSubnetMinimalisticIsolated() string { @@ -325,3 +369,37 @@ resource "nsxt_vpc_subnet" "test" { access_mode = "Public" }`, testAccNsxtPolicyMultitenancyContext(), accTestVpcSubnetUpdateAttributes["display_name"]) } + +func testAccNsxtVpcSubnetReservedIPRangeTemplate(createFlow bool) string { + attrMap := accTestVpcSubnetReservedIPRangeAttributes + + return fmt.Sprintf(` +resource "nsxt_vpc_subnet" "test" { +%s + display_name = "%s" + description = "%s" + ip_addresses = ["%s"] + + access_mode = "Public" + + dhcp_config { + mode = "DHCP_SERVER" + + dhcp_server_additional_config { + options { + option121 { + static_route { + network = "2.1.1.0/24" + next_hop = "2.3.1.3" + } + } + other { + code = "119" + values = ["abc", "def"] + } + } + reserved_ip_ranges = ["%s"] + } + } +}`, testAccNsxtPolicyMultitenancyContext(), attrMap["display_name"], attrMap["description"], attrMap["ip_addresses"], attrMap["reserved_ip_ranges"]) +} diff --git a/nsxt/resource_nsxt_vpc_test.go b/nsxt/resource_nsxt_vpc_test.go index 45c4aa52f..95cb8c78b 100644 --- a/nsxt/resource_nsxt_vpc_test.go +++ b/nsxt/resource_nsxt_vpc_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/segment_common.go b/nsxt/segment_common.go index 2d1e069f5..62065581b 100644 --- a/nsxt/segment_common.go +++ b/nsxt/segment_common.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package nsxt import ( diff --git a/nsxt/ssl_utils.go b/nsxt/ssl_utils.go index 4f1ecc32d..6828e4544 100644 --- a/nsxt/ssl_utils.go +++ b/nsxt/ssl_utils.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/util/utils.go b/nsxt/util/utils.go index 562d66402..cf4ab8960 100644 --- a/nsxt/util/utils.go +++ b/nsxt/util/utils.go @@ -1,3 +1,7 @@ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 + package util import ( diff --git a/nsxt/utils.go b/nsxt/utils.go index 8bfe75f08..d28f0db34 100644 --- a/nsxt/utils.go +++ b/nsxt/utils.go @@ -1,5 +1,6 @@ -/* Copyright © 2017 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/utils_test.go b/nsxt/utils_test.go index f1483e394..eaede4182 100644 --- a/nsxt/utils_test.go +++ b/nsxt/utils_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/validator_test.go b/nsxt/validator_test.go index 64880b4ea..879d543c0 100644 --- a/nsxt/validator_test.go +++ b/nsxt/validator_test.go @@ -1,5 +1,6 @@ -/* Copyright © 2024 Broadcom, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/nsxt/validators.go b/nsxt/validators.go index b420e0dff..7470058d2 100644 --- a/nsxt/validators.go +++ b/nsxt/validators.go @@ -1,5 +1,6 @@ -/* Copyright © 2018 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/tools/api-wrapper-generator.py b/tools/api-wrapper-generator.py index 6f64837b6..fe626e551 100644 --- a/tools/api-wrapper-generator.py +++ b/tools/api-wrapper-generator.py @@ -1,4 +1,9 @@ #!/usr/bin/python3 + +# © Broadcom. All Rights Reserved. +# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +# SPDX-License-Identifier: MPL-2.0 + import argparse import atexit import git diff --git a/tools/data_source_nsxt_policy_template b/tools/data_source_nsxt_policy_template index 57f47fc0b..407ad1e54 100644 --- a/tools/data_source_nsxt_policy_template +++ b/tools/data_source_nsxt_policy_template @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/tools/data_source_nsxt_policy_test_template b/tools/data_source_nsxt_policy_test_template index 10d4dee5d..eaed237d5 100644 --- a/tools/data_source_nsxt_policy_test_template +++ b/tools/data_source_nsxt_policy_test_template @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/tools/diffy/diffy.py b/tools/diffy/diffy.py index 42f81ba05..948903288 100755 --- a/tools/diffy/diffy.py +++ b/tools/diffy/diffy.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: latin-1 -*- -# Copyright (c) 2023 VMware, Inc. All Rights Reserved. -# SPDX-License-Identifier: MPL-2.0 +# © Broadcom. All Rights Reserved. +# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +# SPDX-License-Identifier: MPL-2.0 # This script detects difference in model between different versions of NSX spec. List of relevant objects is for now hard-coded. diff --git a/tools/policygen.py b/tools/policygen.py index a703c1c8e..a24d6a8d8 100755 --- a/tools/policygen.py +++ b/tools/policygen.py @@ -1,8 +1,9 @@ #!/usr/bin/python # -*- coding: latin-1 -*- -# Copyright (c) 2017 VMware, Inc. All Rights Reserved. -# SPDX-License-Identifier: MPL-2.0 +# © Broadcom. All Rights Reserved. +# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +# SPDX-License-Identifier: MPL-2.0s # Generating Resources: # 1. Run the following command: python policygen.py @@ -120,7 +121,7 @@ def get_value_for_const(attr, num=1): if num == 0: return value - + def convert_value_to_hcl(attr_type, attr_value): if attr_type == "string": return "\"%s\"" % attr_value diff --git a/tools/resource_nsxt_policy_template b/tools/resource_nsxt_policy_template index e0a2b98d4..ee0b0eb3e 100644 --- a/tools/resource_nsxt_policy_template +++ b/tools/resource_nsxt_policy_template @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/tools/resource_nsxt_policy_test_template b/tools/resource_nsxt_policy_test_template index 6ebbf2cf0..c4e62f849 100644 --- a/tools/resource_nsxt_policy_test_template +++ b/tools/resource_nsxt_policy_test_template @@ -1,5 +1,6 @@ -/* Copyright © 2020 VMware, Inc. All Rights Reserved. - SPDX-License-Identifier: MPL-2.0 */ +// © Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// SPDX-License-Identifier: MPL-2.0 package nsxt diff --git a/tools/terragen.py b/tools/terragen.py index f9bc60bfe..7a14e0752 100755 --- a/tools/terragen.py +++ b/tools/terragen.py @@ -1,9 +1,9 @@ #!/usr/bin/python # -*- coding: latin-1 -*- -# Copyright (c) 2017 VMware, Inc. All Rights Reserved. -# SPDX-License-Identifier: MPL-2.0 - +# © Broadcom. All Rights Reserved. +# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +# SPDX-License-Identifier: MPL-2.0 import sys import re @@ -77,8 +77,9 @@ def pretty_writeln(f, line): def write_header(f): - pretty_writeln(f, "/* Copyright © 2018 VMware, Inc. All Rights Reserved.") - pretty_writeln(f, " SPDX-License-Identifier: MPL-2.0 */\n") + pretty_writeln(f, "// © Broadcom. All Rights Reserved.") + pretty_writeln(f, "// The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.") + pretty_writeln(f, "// SPDX-License-Identifier: MPL-2.0\n") pretty_writeln(f, "package %s\n" % PACKAGE_NAME) pretty_writeln(f, "import (") diff --git a/website/docs/d/ns_services.html.markdown b/website/docs/d/ns_services.html.markdown index c5409c25a..563232efe 100644 --- a/website/docs/d/ns_services.html.markdown +++ b/website/docs/d/ns_services.html.markdown @@ -7,7 +7,7 @@ description: A networking and security services data source. This data source bu # nsxt_ns_services -This data source builds a "name to uuid" map of the whole NS Services table. Such map can be referenced in configuration to obtain object uuids by display name at a cost of single roudtrip to NSX, which improves apply and refresh +This data source builds a "name to uuid" map of the whole NS Services table. Such map can be referenced in configuration to obtain object uuids by display name at a cost of single roundtrip to NSX, which improves apply and refresh time at scale, compared to multiple instances of `nsxt_ns_service` data source. ## Example Usage diff --git a/website/docs/d/policy_groups.html.markdown b/website/docs/d/policy_groups.html.markdown new file mode 100644 index 000000000..9fc9ab022 --- /dev/null +++ b/website/docs/d/policy_groups.html.markdown @@ -0,0 +1,63 @@ +--- +subcategory: "Firewall" +layout: "nsxt" +page_title: "NSXT: policy_groups" +description: A policy groups data source. This data source builds "display name to policy paths" map representation of the whole table. +--- + +# nsxt_policy_groups + +This data source builds a "name to paths" map of the whole policy Groups table. Such map can be referenced in configuration to obtain object identifier attributes by display name at a cost of single roundtrip to NSX, which improves apply and refresh +time at scale, compared to multiple instances of `nsxt_policy_group` data source. + +## Example Usage + +```hcl +data "nsxt_policy_groups" "map" { +} + +resource "nsxt_policy_predefined_security_policy" "test" { + path = data.nsxt_policy_security_policy.default_l3.path + + tag { + scope = "color" + tag = "orange" + } + + rule { + display_name = "allow_icmp" + destination_groups = [data.nsxt_policy_groups.items["Cats"], data.nsxt_policy_groups.items["Dogs"]] + action = "ALLOW" + services = [nsxt_policy_service.icmp.path] + logged = true + } + + rule { + display_name = "allow_udp" + source_groups = [data.nsxt_policy_groups.items["Fish"]] + sources_excluded = true + scope = [data.nsxt_policy_groups.items["Aquarium"]] + action = "ALLOW" + services = [nsxt_policy_service.udp.path] + logged = true + disabled = true + } + + default_rule { + action = "DROP" + } + +} +``` + +## Argument Reference + +* `domain` - (Optional) The domain this Group belongs to. For VMware Cloud on AWS use `cgw`. For Global Manager, please use site id for this field. If not specified, this field is default to `default`. +* `context` - (Optional) The context which the object belongs to + * `project_id` - (Required) The ID of the project which the object belongs to + +## Attributes Reference + +In addition to arguments listed above, the following attributes are exported: + +* `items` - Map of policy service policy paths keyed by display name. diff --git a/website/docs/d/policy_services.html.markdown b/website/docs/d/policy_services.html.markdown new file mode 100644 index 000000000..ab6adfb9a --- /dev/null +++ b/website/docs/d/policy_services.html.markdown @@ -0,0 +1,47 @@ +--- +subcategory: "Firewall" +layout: "nsxt" +page_title: "NSXT: policy_services" +description: A policy services data source. This data source builds "display name to policy path" map representation of the whole table. +--- + +# nsxt_policy_services + +This data source builds a "name to policy path" map of the whole policy Services table. Such map can be referenced in configuration to obtain object identifier attributes by display name at a cost of single roundtrip to NSX, which improves apply and refresh +time at scale, compared to multiple instances of `nsxt_policy_service` data source. + +## Example Usage + +```hcl +data "nsxt_policy_services" "map" { +} + +resource "nsxt_policy_nat_rule" "dnat1" { + display_name = "dnat_rule1" + action = "DNAT" + source_networks = ["9.1.1.1", "9.2.1.1"] + destination_networks = ["11.1.1.1"] + translated_networks = ["10.1.1.1"] + gateway_path = nsxt_policy_tier1_gateway.t1gateway.path + logging = false + firewall_match = "MATCH_INTERNAL_ADDRESS" + policy_based_vpn_mode = "BYPASS" + service = data.nsxt_policy_services.map.items["DNS-UDP"] + + tag { + scope = "color" + tag = "blue" + } +} +``` + +## Argument Reference + +* `context` - (Optional) The context which the object belongs to + * `project_id` - (Required) The ID of the project which the object belongs to + +## Attributes Reference + +In addition to arguments listed above, the following attributes are exported: + +* `items` - Map of policy service policy paths keyed by display name. diff --git a/website/docs/r/edge_transport_node.html.markdown b/website/docs/r/edge_transport_node.html.markdown index 9a0ac8d01..1a01978ac 100644 --- a/website/docs/r/edge_transport_node.html.markdown +++ b/website/docs/r/edge_transport_node.html.markdown @@ -105,11 +105,32 @@ The following arguments are supported: * `host_switch_profile` - (Optional) Identifiers of host switch profiles to be associated with this host switch. * `ip_assignment` - (Required) - Specification for IPs to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: * `assigned_by_dhcp` - (Optional) Enables DHCP assignment. + * `no_ipv4` - (Optional) No IPv4 for this host switch. * `static_ip` - (Optional) IP assignment specification for Static IP List. * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. - * `subnet_mask` - (Required) Subnet mask. - * `default_gateway` - (Required) Gateway IP. + * `subnet_mask` - (Required) Subnet mask + * `default_gateway` - (Required) Gateway IP + * `static_ip_mac` - (Optional) IP assignment specification for Static IP + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IP address + * `mac_address` - (Required) MAC address + * `subnet_mask` - (Required) Subnet mask + * `default_gateway` - (Required) Gateway IP * `static_ip_pool` - (Optional) IP assignment specification for Static IP Pool. Pool ID is expected here (if `nsxt_policy_ip_pool` object is referenced here, please use `realized_id` attribute) + * `ipv6_assignment` - (Optional) - Specification for IPv6 to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: + * `assigned_by_dhcpv6` - (Optional) Enables DHCP assignment. + * `assigned_by_autoconf` - (Optional) Enables autoconf assignment. + * `no_ipv6` - (Optional) No IPv6 for this host switch. + * `static_ip` - (Optional) IP assignment specification for Static IP List. + * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. + * `prefix_length` - (Required) Prefix Length. + * `default_gateway` - (Required) Gateway IP. + * `static_ip_mac` - (Optional) IP assignment specification for Static IPv6 + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IPv6 address + * `mac_address` - (Required) MAC address + * `prefix_length` - (Required) Prefix Length. + * `default_gateway` - (Required) Gateway IP. * `pnic` - (Optional) Physical NICs connected to the host switch. * `device_name` - (Required) Device name or key. * `uplink_name` - (Required) Uplink name for this Pnic. diff --git a/website/docs/r/policy_host_transport_node.html.markdown b/website/docs/r/policy_host_transport_node.html.markdown index 034e9836a..4005172e2 100644 --- a/website/docs/r/policy_host_transport_node.html.markdown +++ b/website/docs/r/policy_host_transport_node.html.markdown @@ -66,13 +66,35 @@ The following arguments are supported: * `host_switch_name` - (Optional) Host switch name. This name will be used to reference a host switch. * `host_switch_mode` - (Optional) Operational mode of a HostSwitch. Accepted values - 'STANDARD', 'ENS', 'ENS_INTERRUPT' or 'LEGACY'. * `host_switch_profile` - (Optional) Policy path of host switch profiles to be associated with this host switch. - * `ip_assignment` - (Required) - Specification for IPs to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: + * `ip_assignment` - (Optional) - Specification for IPs to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: * `assigned_by_dhcp` - (Optional) Enables DHCP assignment. + * `no_ipv4` - (Optional) No IPv4 for this host switch. * `static_ip` - (Optional) IP assignment specification for Static IP List. * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. * `subnet_mask` - (Required) Subnet mask. - * `default_gateway` - (Required) Gateway IP. + * `default_gateway` - (Required) Gateway IP + * `static_ip_mac` - (Optional) IP assignment specification for Static IP + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IPv6 address + * `mac_address` - (Required) MAC address + * `subnet_mask` - (Required) Subnet mask + * `default_gateway` - (Required) Gateway IP * `static_ip_pool` - (Optional) Policy path of Static IP Pool used for IP assignment specification. + * `ipv6_assignment` - (Optional) - Specification for IPv6 to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: + * `assigned_by_dhcpv6` - (Optional) Enables DHCP assignment. + * `assigned_by_autoconf` - (Optional) Enables autoconf assignment. + * `no_ipv6` - (Optional) No IPv6 for this host switch. + * `static_ip` - (Optional) IP assignment specification for Static IP List. + * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. + * `prefix_length` - (Required) Prefix Length + * `default_gateway` - (Required) Gateway IP + * `static_ip_mac` - (Optional) IP assignment specification for Static IPv6 + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IPv6 address + * `mac_address` - (Required) MAC address + * `prefix_length` - (Required) Prefix Length + * `default_gateway` - (Required) Gateway IP + * `static_ip_pool` - (Optional) Policy path of Static IP Pool used for IPv6 assignment specification. * `is_migrate_pnics` - (Optional) Migrate any pnics which are in use. * `pnic` - (Optional) Physical NICs connected to the host switch. * `device_name` - (Required) Device name or key. @@ -83,11 +105,33 @@ The following arguments are supported: * `host_switch_profile` - (Optional) Identifiers of host switch profiles to be associated with this host switch. * `ip_assignment` - (Required) - Specification for IPs to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: * `assigned_by_dhcp` - (Optional) Enables DHCP assignment. + * `no_ipv4` - (Optional) No IPv4 for this host switch. * `static_ip` - (Optional) IP assignment specification for Static IP List. * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. - * `subnet_mask` - (Required) Subnet mask. - * `default_gateway` - (Required) Gateway IP. + * `subnet_mask` - (Required) Subnet mask + * `default_gateway` - (Required) Gateway IP + * `static_ip_mac` - (Optional) IP assignment specification for Static IP + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IP address + * `mac_address` - (Required) MAC address + * `subnet_mask` - (Required) Subnet mask + * `default_gateway` - (Required) Gateway IP * `static_ip_pool` - (Optional) IP assignment specification for Static IP Pool. + * `ipv6_assignment` - (Optional) - Specification for IPv6 to be used with host switch virtual tunnel endpoints. Should contain exatly one of the below: + * `assigned_by_dhcpv6` - (Optional) Enables DHCP assignment. + * `assigned_by_autoconf` - (Optional) Enables autoconf assignment. + * `no_ipv6` - (Optional) No IPv6 for this host switch. + * `static_ip` - (Optional) IP assignment specification for Static IP List. + * `ip_addresses` - (Required) List of IPs for transport node host switch virtual tunnel endpoints. + * `prefix_length` - (Required) Prefix Length. + * `default_gateway` - (Required) Gateway IP. + * `static_ip_mac` - (Optional) IP assignment specification for Static IPv6 + MAC Pair List. + * `ip_mac_pair` - (Required) List of IP MAC Pairs + * `ip_address` - (Required) IPv6 address + * `mac_address` - (Required) MAC address + * `prefix_length` - (Required) Prefix Length. + * `default_gateway` - (Required) Gateway IP. + * `static_ip_pool` - (Optional) Policy path of Static IP Pool used for IPv6 assignment specification. * `uplink` - (Optional) Uplink/LAG of VMware vSphere Distributed Switch connected to the HostSwitch. * `uplink_name` - (Required) Uplink name from UplinkHostSwitch profile. * `vds_lag_name` - (Optional) Link Aggregation Group (LAG) name of Virtual Distributed Switch. diff --git a/website/docs/r/policy_host_transport_node_collection.html.markdown b/website/docs/r/policy_host_transport_node_collection.html.markdown index 9998d73f0..8557666b8 100644 --- a/website/docs/r/policy_host_transport_node_collection.html.markdown +++ b/website/docs/r/policy_host_transport_node_collection.html.markdown @@ -18,14 +18,14 @@ data "vsphere_compute_cluster" "compute_cluster" { datacenter_id = data.vsphere_datacenter.datacenter.id } +data "nsxt_compute_collection" "compute_cluster_collection" { + display_name = data.vsphere_compute_cluster.compute_cluster.name +} + resource "nsxt_policy_host_transport_node_collection" "htnc1" { display_name = "HostTransportNodeCollection1" - compute_collection_id = data.vsphere_compute_cluster.compute_cluster.id + compute_collection_id = data.nsxt_compute_collection.compute_cluster_collection.id transport_node_profile_path = nsxt_policy_host_transport_node_profile.tnp.path - tag { - scope = "color" - tag = "red" - } } ```