From f530a6e47dbc3cf5090d3ab3bdfe5c6a22061166 Mon Sep 17 00:00:00 2001 From: danischm Date: Wed, 18 Oct 2023 20:25:11 +0200 Subject: [PATCH] Cleanup vedge inventory attributes and fix tests --- docs/data-sources/device.md | 4 +-- docs/data-sources/vedge_inventory.md | 1 - .../data-sources/sdwan_device/data-source.tf | 4 +-- gen/definitions/generic/device.yaml | 14 ++++----- gen/definitions/generic/vedge_inventory.yaml | 16 +++++----- gen/templates/generic/data_source_test.go | 11 ++++++- ...source_sdwan_acl_policy_definition_test.go | 1 - ...spection_profile_policy_definition_test.go | 1 - ...lware_protection_policy_definition_test.go | 1 - ...sdwan_allow_url_list_policy_object_test.go | 1 - ...dwan_app_probe_class_policy_object_test.go | 1 - ...on_aware_routing_policy_definition_test.go | 1 - ...wan_application_list_policy_object_test.go | 1 - ...e_sdwan_as_path_list_policy_object_test.go | 1 - ...sdwan_block_url_list_policy_object_test.go | 1 - ...ta_source_sdwan_centralized_policy_test.go | 1 - ...rce_sdwan_cflowd_policy_definition_test.go | 1 - ...urce_sdwan_class_map_policy_object_test.go | 1 - ...a_source_sdwan_cli_device_template_test.go | 1 - ...rce_sdwan_color_list_policy_object_test.go | 1 - ...control_topology_policy_definition_test.go | 1 - ...ata_fqdn_prefix_list_policy_object_test.go | 1 - ...ata_ipv4_prefix_list_policy_object_test.go | 1 - ...ata_ipv6_prefix_list_policy_object_test.go | 1 - ...sdwan_device_acl_policy_definition_test.go | 1 - .../provider/data_source_sdwan_device_test.go | 30 +++++-------------- ...ce_sdwan_domain_list_policy_object_test.go | 1 - ...anded_community_list_policy_object_test.go | 1 - ...ended_community_list_policy_object_test.go | 1 - ...urce_sdwan_feature_device_template_test.go | 1 - ...an_geo_location_list_policy_object_test.go | 1 - ...d_spoke_topology_policy_definition_test.go | 1 - ...usion_prevention_policy_definition_test.go | 1 - ...n_ips_signature_list_policy_object_test.go | 1 - ...wan_ipv4_prefix_list_policy_object_test.go | 1 - ...wan_ipv6_prefix_list_policy_object_test.go | 1 - ...cal_application_list_policy_object_test.go | 1 - ...data_source_sdwan_localized_policy_test.go | 1 - ...an_mesh_topology_policy_definition_test.go | 1 - ..._source_sdwan_mirror_policy_object_test.go | 1 - ...wan_object_group_policy_definition_test.go | 1 - ...source_sdwan_policer_policy_object_test.go | 1 - ...urce_sdwan_port_list_policy_object_test.go | 1 - ...referred_color_group_policy_object_test.go | 1 - ..._sdwan_protocol_list_policy_object_test.go | 1 - ...ce_sdwan_qos_map_policy_definition_test.go | 1 - ...ce_sdwan_region_list_policy_object_test.go | 1 - ...wan_rewrite_rule_policy_definition_test.go | 1 - ...urce_sdwan_route_policy_definition_test.go | 1 - ...e_sdwan_rule_set_policy_definition_test.go | 1 - ...urce_sdwan_site_list_policy_object_test.go | 1 - ...urce_sdwan_sla_class_policy_object_test.go | 1 - ...ndard_community_list_policy_object_test.go | 1 - ...urce_sdwan_tloc_list_policy_object_test.go | 1 - ...s_ssl_decryption_policy_definition_test.go | 1 - ..._tls_ssl_profile_policy_definition_test.go | 1 - ...wan_traffic_data_policy_definition_test.go | 1 - ...an_url_filtering_policy_definition_test.go | 1 - .../data_source_sdwan_vedge_inventory.go | 4 --- .../data_source_sdwan_vedge_inventory_test.go | 21 ++----------- ...ource_sdwan_vpn_list_policy_object_test.go | 1 - ...n_vpn_membership_policy_definition_test.go | 1 - ...urce_sdwan_zone_list_policy_object_test.go | 1 - .../provider/model_sdwan_vedge_inventory.go | 12 -------- 64 files changed, 37 insertions(+), 134 deletions(-) diff --git a/docs/data-sources/device.md b/docs/data-sources/device.md index 0c3894cf..d335be35 100644 --- a/docs/data-sources/device.md +++ b/docs/data-sources/device.md @@ -14,8 +14,8 @@ This data source can read the Device . ```terraform data "sdwan_device" "example" { - serial_number = "2AJC9DJ" - name = "va-001" + serial_number = "EE16A1C0BAD74974AF666E446F15605F" + name = "vsmart" } ``` diff --git a/docs/data-sources/vedge_inventory.md b/docs/data-sources/vedge_inventory.md index 176547dc..3f223095 100644 --- a/docs/data-sources/vedge_inventory.md +++ b/docs/data-sources/vedge_inventory.md @@ -24,7 +24,6 @@ data "sdwan_vedge_inventory" "example" { - `devices` (Attributes List) List of returned devices (see [below for nested schema](#nestedatt--devices)) - `id` (String) The id of the object -- `name` (String) The hostname of a device ### Nested Schema for `devices` diff --git a/examples/data-sources/sdwan_device/data-source.tf b/examples/data-sources/sdwan_device/data-source.tf index e96ae596..c64be4f3 100644 --- a/examples/data-sources/sdwan_device/data-source.tf +++ b/examples/data-sources/sdwan_device/data-source.tf @@ -1,4 +1,4 @@ data "sdwan_device" "example" { - serial_number = "2AJC9DJ" - name = "va-001" + serial_number = "EE16A1C0BAD74974AF666E446F15605F" + name = "vsmart" } diff --git a/gen/definitions/generic/device.yaml b/gen/definitions/generic/device.yaml index fdc3446c..2701faf6 100644 --- a/gen/definitions/generic/device.yaml +++ b/gen/definitions/generic/device.yaml @@ -9,14 +9,14 @@ attributes: tf_name: serial_number type: String description: Serial number for device. Could be board or virtual identifier - example: 2AJC9DJ + example: EE16A1C0BAD74974AF666E446F15605F query_param: true - model_name: host-name tf_name: name type: String query_param: true description: The hostname of a device - example: va-001 + example: vsmart - model_name: data tf_name: devices type: List @@ -25,28 +25,28 @@ attributes: - model_name: deviceId type: String tf_name: device_id - example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d + example: 10.0.0.14 description: The device ID as defined in vManage - model_name: uuid type: String description: Unique identifier for device id: true - example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d + example: cd4aa06a-dee3-43c5-bb95-2a1b29cb86e2 - model_name: site-id tf_name: site_id type: String description: Site id for respective device - example: 400 + example: 1 - model_name: board-serial tf_name: serial_number type: String description: Serial number for device. Could be board or virtual identifier - example: 2AJC9DJ + example: EE16A1C0BAD74974AF666E446F15605F - model_name: host-name tf_name: hostname type: String description: Hostname for respective device - example: vEdge-123 + example: vsmart - model_name: reachability type: String description: Reachability of device diff --git a/gen/definitions/generic/vedge_inventory.yaml b/gen/definitions/generic/vedge_inventory.yaml index 4ae610b4..dfe45dbb 100644 --- a/gen/definitions/generic/vedge_inventory.yaml +++ b/gen/definitions/generic/vedge_inventory.yaml @@ -5,11 +5,6 @@ doc_category: Inventory remove_id: true skip_templates: ["resource.go", "resource_test.go", "resource.tf", "import.sh"] attributes: - - model_name: host-name - tf_name: name - type: String - description: The hostname of a device - example: va-001 - model_name: data tf_name: devices type: List @@ -20,26 +15,29 @@ attributes: type: String description: Chassis Number id: true - example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d + example: ISR-7C260167-7A6C-628A-00A6-A30214119017 - model_name: site-id tf_name: site_id type: String description: Site id for respective device - example: 400 + example: 1 + exclude_test: true - model_name: serialNumber tf_name: serial_number type: String description: Serial number for device. Could be board or virtual identifier - example: 2AJC9DJ + example: d4da6eb56aca4a5a884688ed25abcaed - model_name: host-name tf_name: hostname type: String description: Hostname for respective device - example: vEdge-123 + example: router1 + exclude_test: true - model_name: validity type: String description: Validity of device example: valid + exclude_test: true - model_name: deviceType tf_name: device_type type: String diff --git a/gen/templates/generic/data_source_test.go b/gen/templates/generic/data_source_test.go index bd46fffc..1ebdbb82 100644 --- a/gen/templates/generic/data_source_test.go +++ b/gen/templates/generic/data_source_test.go @@ -38,7 +38,7 @@ func TestAccDataSourceSdwan{{camelCase .Name}}(t *testing.T) { Check: resource.ComposeTestCheckFunc( {{- $name := .Name }} {{- range .Attributes}} - {{- if and (not .WriteOnly) (not .ExcludeTest) (not .TfOnly) (not .Value) (not .TestValue)}} + {{- if and (not .WriteOnly) (not .ExcludeTest) (not .TfOnly) (not .Value) (not .TestValue) (not .QueryParam)}} {{- if or (eq .Type "List") (eq .Type "Set")}} {{- $list := .TfName }} {{- range .Attributes}} @@ -78,6 +78,7 @@ func TestAccDataSourceSdwan{{camelCase .Name}}(t *testing.T) { const testAccDataSourceSdwan{{camelCase .Name}}Config = ` {{if .TestPrerequisites}}{{.TestPrerequisites}}{{end}} +{{- if not (contains .SkipTemplates "resource.go")}} resource "sdwan_{{snakeCase $name}}" "test" { {{- range .Attributes}} {{- if and (not .ExcludeTest) (not .TfOnly) (not .Value)}} @@ -115,8 +116,16 @@ resource "sdwan_{{snakeCase $name}}" "test" { {{- end}} {{- end}} } +{{- end}} data "sdwan_{{snakeCase .Name}}" "test" { +{{- range .Attributes}} +{{- if .QueryParam}} + {{.TfName}} = {{if eq .Type "String"}}"{{.Example}}"{{else if eq .Type "StringList"}}["{{.Example}}"]{{else}}{{.Example}}{{end}} +{{- end}} +{{- end}} +{{- if not .RemoveId}} id = sdwan_{{snakeCase $name}}.test.id +{{- end}} } ` diff --git a/internal/provider/data_source_sdwan_acl_policy_definition_test.go b/internal/provider/data_source_sdwan_acl_policy_definition_test.go index 338a0189..4c846123 100644 --- a/internal/provider/data_source_sdwan_acl_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_acl_policy_definition_test.go @@ -53,7 +53,6 @@ func TestAccDataSourceSdwanACLPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanACLPolicyDefinitionConfig = ` - resource "sdwan_acl_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_advanced_inspection_profile_policy_definition_test.go b/internal/provider/data_source_sdwan_advanced_inspection_profile_policy_definition_test.go index 6556fda9..26a43647 100644 --- a/internal/provider/data_source_sdwan_advanced_inspection_profile_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_advanced_inspection_profile_policy_definition_test.go @@ -56,7 +56,6 @@ resource "sdwan_url_filtering_policy_definition" "test" { block_page_contents = "Access to the requested page has been denied. Please contact your Network Administrator" } - resource "sdwan_advanced_inspection_profile_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_advanced_malware_protection_policy_definition_test.go b/internal/provider/data_source_sdwan_advanced_malware_protection_policy_definition_test.go index 870448eb..e3a35693 100644 --- a/internal/provider/data_source_sdwan_advanced_malware_protection_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_advanced_malware_protection_policy_definition_test.go @@ -50,7 +50,6 @@ func TestAccDataSourceSdwanAdvancedMalwareProtectionPolicyDefinition(t *testing. const testAccDataSourceSdwanAdvancedMalwareProtectionPolicyDefinitionConfig = ` - resource "sdwan_advanced_malware_protection_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_allow_url_list_policy_object_test.go b/internal/provider/data_source_sdwan_allow_url_list_policy_object_test.go index 2438c801..a84f3ad2 100644 --- a/internal/provider/data_source_sdwan_allow_url_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_allow_url_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanAllowURLListPolicyObject(t *testing.T) { const testAccDataSourceSdwanAllowURLListPolicyObjectConfig = ` - resource "sdwan_allow_url_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_app_probe_class_policy_object_test.go b/internal/provider/data_source_sdwan_app_probe_class_policy_object_test.go index b5dbf98a..06e88548 100644 --- a/internal/provider/data_source_sdwan_app_probe_class_policy_object_test.go +++ b/internal/provider/data_source_sdwan_app_probe_class_policy_object_test.go @@ -45,7 +45,6 @@ func TestAccDataSourceSdwanAppProbeClassPolicyObject(t *testing.T) { const testAccDataSourceSdwanAppProbeClassPolicyObjectConfig = ` - resource "sdwan_app_probe_class_policy_object" "test" { name = "Example" forwarding_class = "FC1" diff --git a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go index 369159ce..8dbcabc5 100644 --- a/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_application_aware_routing_policy_definition_test.go @@ -50,7 +50,6 @@ func TestAccDataSourceSdwanApplicationAwareRoutingPolicyDefinition(t *testing.T) const testAccDataSourceSdwanApplicationAwareRoutingPolicyDefinitionConfig = ` - resource "sdwan_application_aware_routing_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_application_list_policy_object_test.go b/internal/provider/data_source_sdwan_application_list_policy_object_test.go index 6d4731ae..7851eb50 100644 --- a/internal/provider/data_source_sdwan_application_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_application_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanApplicationListPolicyObject(t *testing.T) { const testAccDataSourceSdwanApplicationListPolicyObjectConfig = ` - resource "sdwan_application_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_as_path_list_policy_object_test.go b/internal/provider/data_source_sdwan_as_path_list_policy_object_test.go index 06d2b27b..bab5d016 100644 --- a/internal/provider/data_source_sdwan_as_path_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_as_path_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanASPathListPolicyObject(t *testing.T) { const testAccDataSourceSdwanASPathListPolicyObjectConfig = ` - resource "sdwan_as_path_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_block_url_list_policy_object_test.go b/internal/provider/data_source_sdwan_block_url_list_policy_object_test.go index f3254d0d..ed38b83b 100644 --- a/internal/provider/data_source_sdwan_block_url_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_block_url_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanBlockURLListPolicyObject(t *testing.T) { const testAccDataSourceSdwanBlockURLListPolicyObjectConfig = ` - resource "sdwan_block_url_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_centralized_policy_test.go b/internal/provider/data_source_sdwan_centralized_policy_test.go index 887abe93..2b216c2e 100644 --- a/internal/provider/data_source_sdwan_centralized_policy_test.go +++ b/internal/provider/data_source_sdwan_centralized_policy_test.go @@ -82,7 +82,6 @@ resource "sdwan_traffic_data_policy_definition" "data1" { ] } - resource "sdwan_centralized_policy" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_cflowd_policy_definition_test.go b/internal/provider/data_source_sdwan_cflowd_policy_definition_test.go index a04f241a..d66e3438 100644 --- a/internal/provider/data_source_sdwan_cflowd_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_cflowd_policy_definition_test.go @@ -56,7 +56,6 @@ func TestAccDataSourceSdwanCflowdPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanCflowdPolicyDefinitionConfig = ` - resource "sdwan_cflowd_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_class_map_policy_object_test.go b/internal/provider/data_source_sdwan_class_map_policy_object_test.go index 37c4d2cb..b02a06f9 100644 --- a/internal/provider/data_source_sdwan_class_map_policy_object_test.go +++ b/internal/provider/data_source_sdwan_class_map_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanClassMapPolicyObject(t *testing.T) { const testAccDataSourceSdwanClassMapPolicyObjectConfig = ` - resource "sdwan_class_map_policy_object" "test" { name = "Example" queue = 2 diff --git a/internal/provider/data_source_sdwan_cli_device_template_test.go b/internal/provider/data_source_sdwan_cli_device_template_test.go index 0954740d..8c0b0656 100644 --- a/internal/provider/data_source_sdwan_cli_device_template_test.go +++ b/internal/provider/data_source_sdwan_cli_device_template_test.go @@ -46,7 +46,6 @@ func TestAccDataSourceSdwanCLIDeviceTemplate(t *testing.T) { const testAccDataSourceSdwanCLIDeviceTemplateConfig = ` - resource "sdwan_cli_device_template" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_color_list_policy_object_test.go b/internal/provider/data_source_sdwan_color_list_policy_object_test.go index d262649d..bdf2e266 100644 --- a/internal/provider/data_source_sdwan_color_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_color_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanColorListPolicyObject(t *testing.T) { const testAccDataSourceSdwanColorListPolicyObjectConfig = ` - resource "sdwan_color_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_custom_control_topology_policy_definition_test.go b/internal/provider/data_source_sdwan_custom_control_topology_policy_definition_test.go index 415d45df..fb363f92 100644 --- a/internal/provider/data_source_sdwan_custom_control_topology_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_custom_control_topology_policy_definition_test.go @@ -53,7 +53,6 @@ func TestAccDataSourceSdwanCustomControlTopologyPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanCustomControlTopologyPolicyDefinitionConfig = ` - resource "sdwan_custom_control_topology_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_data_fqdn_prefix_list_policy_object_test.go b/internal/provider/data_source_sdwan_data_fqdn_prefix_list_policy_object_test.go index a0449347..d854f1bf 100644 --- a/internal/provider/data_source_sdwan_data_fqdn_prefix_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_data_fqdn_prefix_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanDataFQDNPrefixListPolicyObject(t *testing.T) { const testAccDataSourceSdwanDataFQDNPrefixListPolicyObjectConfig = ` - resource "sdwan_data_fqdn_prefix_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_data_ipv4_prefix_list_policy_object_test.go b/internal/provider/data_source_sdwan_data_ipv4_prefix_list_policy_object_test.go index 62550ec0..7549b17b 100644 --- a/internal/provider/data_source_sdwan_data_ipv4_prefix_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_data_ipv4_prefix_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanDataIPv4PrefixListPolicyObject(t *testing.T) { const testAccDataSourceSdwanDataIPv4PrefixListPolicyObjectConfig = ` - resource "sdwan_data_ipv4_prefix_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_data_ipv6_prefix_list_policy_object_test.go b/internal/provider/data_source_sdwan_data_ipv6_prefix_list_policy_object_test.go index a0bfe25f..42c4ce9f 100644 --- a/internal/provider/data_source_sdwan_data_ipv6_prefix_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_data_ipv6_prefix_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanDataIPv6PrefixListPolicyObject(t *testing.T) { const testAccDataSourceSdwanDataIPv6PrefixListPolicyObjectConfig = ` - resource "sdwan_data_ipv6_prefix_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_device_acl_policy_definition_test.go b/internal/provider/data_source_sdwan_device_acl_policy_definition_test.go index bc4e2c7d..4633a433 100644 --- a/internal/provider/data_source_sdwan_device_acl_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_device_acl_policy_definition_test.go @@ -52,7 +52,6 @@ func TestAccDataSourceSdwanDeviceACLPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanDeviceACLPolicyDefinitionConfig = ` - resource "sdwan_device_acl_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_device_test.go b/internal/provider/data_source_sdwan_device_test.go index 70fc3e63..7cf0fa15 100644 --- a/internal/provider/data_source_sdwan_device_test.go +++ b/internal/provider/data_source_sdwan_device_test.go @@ -33,13 +33,11 @@ func TestAccDataSourceSdwanDevice(t *testing.T) { { Config: testAccDataSourceSdwanDeviceConfig, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.sdwan_device.test", "serial_number", "2AJC9DJ"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "name", "va-001"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.device_id", "2081c2f4-3f9f-4fee-8078-dcc8904e368d"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.uuid", "2081c2f4-3f9f-4fee-8078-dcc8904e368d"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.site_id", "400"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.serial_number", "2AJC9DJ"), - resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.hostname", "vEdge-123"), + resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.device_id", "10.0.0.14"), + resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.uuid", "cd4aa06a-dee3-43c5-bb95-2a1b29cb86e2"), + resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.site_id", "1"), + resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.serial_number", "EE16A1C0BAD74974AF666E446F15605F"), + resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.hostname", "vsmart"), resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.reachability", "reachable"), resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.status", "normal"), resource.TestCheckResourceAttr("data.sdwan_device.test", "devices.0.state", "green"), @@ -52,22 +50,8 @@ func TestAccDataSourceSdwanDevice(t *testing.T) { const testAccDataSourceSdwanDeviceConfig = ` -resource "sdwan_device" "test" { - serial_number = "2AJC9DJ" - name = "va-001" - devices = [{ - device_id = "2081c2f4-3f9f-4fee-8078-dcc8904e368d" - uuid = "2081c2f4-3f9f-4fee-8078-dcc8904e368d" - site_id = "400" - serial_number = "2AJC9DJ" - hostname = "vEdge-123" - reachability = "reachable" - status = "normal" - state = "green" - }] -} - data "sdwan_device" "test" { - id = sdwan_device.test.id + serial_number = "EE16A1C0BAD74974AF666E446F15605F" + name = "vsmart" } ` diff --git a/internal/provider/data_source_sdwan_domain_list_policy_object_test.go b/internal/provider/data_source_sdwan_domain_list_policy_object_test.go index 203d844c..147d7f8c 100644 --- a/internal/provider/data_source_sdwan_domain_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_domain_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanDomainListPolicyObject(t *testing.T) { const testAccDataSourceSdwanDomainListPolicyObjectConfig = ` - resource "sdwan_domain_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_expanded_community_list_policy_object_test.go b/internal/provider/data_source_sdwan_expanded_community_list_policy_object_test.go index 1261119d..66f76553 100644 --- a/internal/provider/data_source_sdwan_expanded_community_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_expanded_community_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanExpandedCommunityListPolicyObject(t *testing.T) { const testAccDataSourceSdwanExpandedCommunityListPolicyObjectConfig = ` - resource "sdwan_expanded_community_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_extended_community_list_policy_object_test.go b/internal/provider/data_source_sdwan_extended_community_list_policy_object_test.go index 94ae2424..5e0644d8 100644 --- a/internal/provider/data_source_sdwan_extended_community_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_extended_community_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanExtendedCommunityListPolicyObject(t *testing.T) { const testAccDataSourceSdwanExtendedCommunityListPolicyObjectConfig = ` - resource "sdwan_extended_community_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_feature_device_template_test.go b/internal/provider/data_source_sdwan_feature_device_template_test.go index ae125b5e..2fd62736 100644 --- a/internal/provider/data_source_sdwan_feature_device_template_test.go +++ b/internal/provider/data_source_sdwan_feature_device_template_test.go @@ -55,7 +55,6 @@ resource "sdwan_cisco_system_feature_template" "system" { multi_tenant = true } - resource "sdwan_feature_device_template" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_geo_location_list_policy_object_test.go b/internal/provider/data_source_sdwan_geo_location_list_policy_object_test.go index dcfc1990..47b6e9ce 100644 --- a/internal/provider/data_source_sdwan_geo_location_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_geo_location_list_policy_object_test.go @@ -44,7 +44,6 @@ func TestAccDataSourceSdwanGeoLocationListPolicyObject(t *testing.T) { const testAccDataSourceSdwanGeoLocationListPolicyObjectConfig = ` - resource "sdwan_geo_location_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_hub_and_spoke_topology_policy_definition_test.go b/internal/provider/data_source_sdwan_hub_and_spoke_topology_policy_definition_test.go index 8cbae945..5c14a291 100644 --- a/internal/provider/data_source_sdwan_hub_and_spoke_topology_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_hub_and_spoke_topology_policy_definition_test.go @@ -61,7 +61,6 @@ resource "sdwan_vpn_list_policy_object" "vpns1" { ] } - resource "sdwan_hub_and_spoke_topology_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_intrusion_prevention_policy_definition_test.go b/internal/provider/data_source_sdwan_intrusion_prevention_policy_definition_test.go index 931ac383..fe93a816 100644 --- a/internal/provider/data_source_sdwan_intrusion_prevention_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_intrusion_prevention_policy_definition_test.go @@ -48,7 +48,6 @@ func TestAccDataSourceSdwanIntrusionPreventionPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanIntrusionPreventionPolicyDefinitionConfig = ` - resource "sdwan_intrusion_prevention_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_ips_signature_list_policy_object_test.go b/internal/provider/data_source_sdwan_ips_signature_list_policy_object_test.go index 6599f202..8ad9c2c5 100644 --- a/internal/provider/data_source_sdwan_ips_signature_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_ips_signature_list_policy_object_test.go @@ -44,7 +44,6 @@ func TestAccDataSourceSdwanIPSSignatureListPolicyObject(t *testing.T) { const testAccDataSourceSdwanIPSSignatureListPolicyObjectConfig = ` - resource "sdwan_ips_signature_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_ipv4_prefix_list_policy_object_test.go b/internal/provider/data_source_sdwan_ipv4_prefix_list_policy_object_test.go index bd16b35b..0115560c 100644 --- a/internal/provider/data_source_sdwan_ipv4_prefix_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_ipv4_prefix_list_policy_object_test.go @@ -45,7 +45,6 @@ func TestAccDataSourceSdwanIPv4PrefixListPolicyObject(t *testing.T) { const testAccDataSourceSdwanIPv4PrefixListPolicyObjectConfig = ` - resource "sdwan_ipv4_prefix_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_ipv6_prefix_list_policy_object_test.go b/internal/provider/data_source_sdwan_ipv6_prefix_list_policy_object_test.go index 2e699bfb..56a32d8f 100644 --- a/internal/provider/data_source_sdwan_ipv6_prefix_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_ipv6_prefix_list_policy_object_test.go @@ -45,7 +45,6 @@ func TestAccDataSourceSdwanIPv6PrefixListPolicyObject(t *testing.T) { const testAccDataSourceSdwanIPv6PrefixListPolicyObjectConfig = ` - resource "sdwan_ipv6_prefix_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_local_application_list_policy_object_test.go b/internal/provider/data_source_sdwan_local_application_list_policy_object_test.go index 62dceef5..4d1f55e1 100644 --- a/internal/provider/data_source_sdwan_local_application_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_local_application_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanLocalApplicationListPolicyObject(t *testing.T) { const testAccDataSourceSdwanLocalApplicationListPolicyObjectConfig = ` - resource "sdwan_local_application_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_localized_policy_test.go b/internal/provider/data_source_sdwan_localized_policy_test.go index b38868df..66c0c663 100644 --- a/internal/provider/data_source_sdwan_localized_policy_test.go +++ b/internal/provider/data_source_sdwan_localized_policy_test.go @@ -84,7 +84,6 @@ resource "sdwan_acl_policy_definition" "test" { ] } - resource "sdwan_localized_policy" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_mesh_topology_policy_definition_test.go b/internal/provider/data_source_sdwan_mesh_topology_policy_definition_test.go index 1cc147d3..a2f19ea2 100644 --- a/internal/provider/data_source_sdwan_mesh_topology_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_mesh_topology_policy_definition_test.go @@ -61,7 +61,6 @@ resource "sdwan_vpn_list_policy_object" "vpns1" { ] } - resource "sdwan_mesh_topology_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_mirror_policy_object_test.go b/internal/provider/data_source_sdwan_mirror_policy_object_test.go index 9b451afc..e43a33a2 100644 --- a/internal/provider/data_source_sdwan_mirror_policy_object_test.go +++ b/internal/provider/data_source_sdwan_mirror_policy_object_test.go @@ -44,7 +44,6 @@ func TestAccDataSourceSdwanMirrorPolicyObject(t *testing.T) { const testAccDataSourceSdwanMirrorPolicyObjectConfig = ` - resource "sdwan_mirror_policy_object" "test" { name = "Example" remote_destination_ip = "10.1.1.1" diff --git a/internal/provider/data_source_sdwan_object_group_policy_definition_test.go b/internal/provider/data_source_sdwan_object_group_policy_definition_test.go index 6891c1e0..88f1bb39 100644 --- a/internal/provider/data_source_sdwan_object_group_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_object_group_policy_definition_test.go @@ -47,7 +47,6 @@ func TestAccDataSourceSdwanObjectGroupPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanObjectGroupPolicyDefinitionConfig = ` - resource "sdwan_object_group_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_policer_policy_object_test.go b/internal/provider/data_source_sdwan_policer_policy_object_test.go index fe12b9ea..20e6cae7 100644 --- a/internal/provider/data_source_sdwan_policer_policy_object_test.go +++ b/internal/provider/data_source_sdwan_policer_policy_object_test.go @@ -45,7 +45,6 @@ func TestAccDataSourceSdwanPolicerPolicyObject(t *testing.T) { const testAccDataSourceSdwanPolicerPolicyObjectConfig = ` - resource "sdwan_policer_policy_object" "test" { name = "Example" burst = 100000 diff --git a/internal/provider/data_source_sdwan_port_list_policy_object_test.go b/internal/provider/data_source_sdwan_port_list_policy_object_test.go index 572edaa7..f17c29e1 100644 --- a/internal/provider/data_source_sdwan_port_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_port_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanPortListPolicyObject(t *testing.T) { const testAccDataSourceSdwanPortListPolicyObjectConfig = ` - resource "sdwan_port_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_preferred_color_group_policy_object_test.go b/internal/provider/data_source_sdwan_preferred_color_group_policy_object_test.go index eeba6d8c..9bce25cd 100644 --- a/internal/provider/data_source_sdwan_preferred_color_group_policy_object_test.go +++ b/internal/provider/data_source_sdwan_preferred_color_group_policy_object_test.go @@ -48,7 +48,6 @@ func TestAccDataSourceSdwanPreferredColorGroupPolicyObject(t *testing.T) { const testAccDataSourceSdwanPreferredColorGroupPolicyObjectConfig = ` - resource "sdwan_preferred_color_group_policy_object" "test" { name = "Example" primary_color_preference = "blue bronze" diff --git a/internal/provider/data_source_sdwan_protocol_list_policy_object_test.go b/internal/provider/data_source_sdwan_protocol_list_policy_object_test.go index 5498772c..9c7d1081 100644 --- a/internal/provider/data_source_sdwan_protocol_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_protocol_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanProtocolListPolicyObject(t *testing.T) { const testAccDataSourceSdwanProtocolListPolicyObjectConfig = ` - resource "sdwan_protocol_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_qos_map_policy_definition_test.go b/internal/provider/data_source_sdwan_qos_map_policy_definition_test.go index 2744a3e7..83d88097 100644 --- a/internal/provider/data_source_sdwan_qos_map_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_qos_map_policy_definition_test.go @@ -53,7 +53,6 @@ resource "sdwan_class_map_policy_object" "test" { queue = 6 } - resource "sdwan_qos_map_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_region_list_policy_object_test.go b/internal/provider/data_source_sdwan_region_list_policy_object_test.go index 6e8aea2d..1b0ac801 100644 --- a/internal/provider/data_source_sdwan_region_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_region_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanRegionListPolicyObject(t *testing.T) { const testAccDataSourceSdwanRegionListPolicyObjectConfig = ` - resource "sdwan_region_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_rewrite_rule_policy_definition_test.go b/internal/provider/data_source_sdwan_rewrite_rule_policy_definition_test.go index 9638f037..4aee8078 100644 --- a/internal/provider/data_source_sdwan_rewrite_rule_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_rewrite_rule_policy_definition_test.go @@ -50,7 +50,6 @@ resource "sdwan_class_map_policy_object" "test" { queue = 6 } - resource "sdwan_rewrite_rule_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_route_policy_definition_test.go b/internal/provider/data_source_sdwan_route_policy_definition_test.go index 4f432d67..2bf4591d 100644 --- a/internal/provider/data_source_sdwan_route_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_route_policy_definition_test.go @@ -53,7 +53,6 @@ func TestAccDataSourceSdwanRoutePolicyDefinition(t *testing.T) { const testAccDataSourceSdwanRoutePolicyDefinitionConfig = ` - resource "sdwan_route_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_rule_set_policy_definition_test.go b/internal/provider/data_source_sdwan_rule_set_policy_definition_test.go index 7104d4d3..f04b3cc9 100644 --- a/internal/provider/data_source_sdwan_rule_set_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_rule_set_policy_definition_test.go @@ -54,7 +54,6 @@ func TestAccDataSourceSdwanRuleSetPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanRuleSetPolicyDefinitionConfig = ` - resource "sdwan_rule_set_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_site_list_policy_object_test.go b/internal/provider/data_source_sdwan_site_list_policy_object_test.go index 2e254def..c508388e 100644 --- a/internal/provider/data_source_sdwan_site_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_site_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanSiteListPolicyObject(t *testing.T) { const testAccDataSourceSdwanSiteListPolicyObjectConfig = ` - resource "sdwan_site_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_sla_class_policy_object_test.go b/internal/provider/data_source_sdwan_sla_class_policy_object_test.go index 60af705c..2218bb00 100644 --- a/internal/provider/data_source_sdwan_sla_class_policy_object_test.go +++ b/internal/provider/data_source_sdwan_sla_class_policy_object_test.go @@ -49,7 +49,6 @@ func TestAccDataSourceSdwanSLAClassPolicyObject(t *testing.T) { const testAccDataSourceSdwanSLAClassPolicyObjectConfig = ` - resource "sdwan_sla_class_policy_object" "test" { name = "Example" jitter = 100 diff --git a/internal/provider/data_source_sdwan_standard_community_list_policy_object_test.go b/internal/provider/data_source_sdwan_standard_community_list_policy_object_test.go index d5606073..d669e983 100644 --- a/internal/provider/data_source_sdwan_standard_community_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_standard_community_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanStandardCommunityListPolicyObject(t *testing.T) { const testAccDataSourceSdwanStandardCommunityListPolicyObjectConfig = ` - resource "sdwan_standard_community_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_tloc_list_policy_object_test.go b/internal/provider/data_source_sdwan_tloc_list_policy_object_test.go index c08a7990..57d6d9e2 100644 --- a/internal/provider/data_source_sdwan_tloc_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_tloc_list_policy_object_test.go @@ -46,7 +46,6 @@ func TestAccDataSourceSdwanTLOCListPolicyObject(t *testing.T) { const testAccDataSourceSdwanTLOCListPolicyObjectConfig = ` - resource "sdwan_tloc_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition_test.go b/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition_test.go index 2c021402..c7d93560 100644 --- a/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_tls_ssl_decryption_policy_definition_test.go @@ -64,7 +64,6 @@ func TestAccDataSourceSdwanTLSSSLDecryptionPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanTLSSSLDecryptionPolicyDefinitionConfig = ` - resource "sdwan_tls_ssl_decryption_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_tls_ssl_profile_policy_definition_test.go b/internal/provider/data_source_sdwan_tls_ssl_profile_policy_definition_test.go index 99593305..46fa710c 100644 --- a/internal/provider/data_source_sdwan_tls_ssl_profile_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_tls_ssl_profile_policy_definition_test.go @@ -50,7 +50,6 @@ func TestAccDataSourceSdwanTLSSSLProfilePolicyDefinition(t *testing.T) { const testAccDataSourceSdwanTLSSSLProfilePolicyDefinitionConfig = ` - resource "sdwan_tls_ssl_profile_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go b/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go index 50de0b2e..edde3e8f 100644 --- a/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go @@ -52,7 +52,6 @@ func TestAccDataSourceSdwanTrafficDataPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanTrafficDataPolicyDefinitionConfig = ` - resource "sdwan_traffic_data_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_url_filtering_policy_definition_test.go b/internal/provider/data_source_sdwan_url_filtering_policy_definition_test.go index 8769d0f5..d85e90b9 100644 --- a/internal/provider/data_source_sdwan_url_filtering_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_url_filtering_policy_definition_test.go @@ -51,7 +51,6 @@ func TestAccDataSourceSdwanURLFilteringPolicyDefinition(t *testing.T) { const testAccDataSourceSdwanURLFilteringPolicyDefinitionConfig = ` - resource "sdwan_url_filtering_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_vedge_inventory.go b/internal/provider/data_source_sdwan_vedge_inventory.go index 76398b73..76e3de8e 100644 --- a/internal/provider/data_source_sdwan_vedge_inventory.go +++ b/internal/provider/data_source_sdwan_vedge_inventory.go @@ -57,10 +57,6 @@ func (d *VEdgeInventoryDataSource) Schema(ctx context.Context, req datasource.Sc MarkdownDescription: "The id of the object", Computed: true, }, - "name": schema.StringAttribute{ - MarkdownDescription: "The hostname of a device", - Computed: true, - }, "devices": schema.ListNestedAttribute{ MarkdownDescription: "List of returned devices", Computed: true, diff --git a/internal/provider/data_source_sdwan_vedge_inventory_test.go b/internal/provider/data_source_sdwan_vedge_inventory_test.go index 886ebba2..18005b8d 100644 --- a/internal/provider/data_source_sdwan_vedge_inventory_test.go +++ b/internal/provider/data_source_sdwan_vedge_inventory_test.go @@ -33,12 +33,8 @@ func TestAccDataSourceSdwanVEdgeInventory(t *testing.T) { { Config: testAccDataSourceSdwanVEdgeInventoryConfig, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "name", "va-001"), - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.chassis_number", "2081c2f4-3f9f-4fee-8078-dcc8904e368d"), - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.site_id", "400"), - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.serial_number", "2AJC9DJ"), - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.hostname", "vEdge-123"), - resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.validity", "valid"), + resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.chassis_number", "ISR-7C260167-7A6C-628A-00A6-A30214119017"), + resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.serial_number", "d4da6eb56aca4a5a884688ed25abcaed"), resource.TestCheckResourceAttr("data.sdwan_vedge_inventory.test", "devices.0.device_type", "vedge"), ), }, @@ -49,19 +45,6 @@ func TestAccDataSourceSdwanVEdgeInventory(t *testing.T) { const testAccDataSourceSdwanVEdgeInventoryConfig = ` -resource "sdwan_vedge_inventory" "test" { - name = "va-001" - devices = [{ - chassis_number = "2081c2f4-3f9f-4fee-8078-dcc8904e368d" - site_id = "400" - serial_number = "2AJC9DJ" - hostname = "vEdge-123" - validity = "valid" - device_type = "vedge" - }] -} - data "sdwan_vedge_inventory" "test" { - id = sdwan_vedge_inventory.test.id } ` diff --git a/internal/provider/data_source_sdwan_vpn_list_policy_object_test.go b/internal/provider/data_source_sdwan_vpn_list_policy_object_test.go index 178bbe7c..53abcaf5 100644 --- a/internal/provider/data_source_sdwan_vpn_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_vpn_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanVPNListPolicyObject(t *testing.T) { const testAccDataSourceSdwanVPNListPolicyObjectConfig = ` - resource "sdwan_vpn_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/data_source_sdwan_vpn_membership_policy_definition_test.go b/internal/provider/data_source_sdwan_vpn_membership_policy_definition_test.go index 8664ba92..6af3c5a1 100644 --- a/internal/provider/data_source_sdwan_vpn_membership_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_vpn_membership_policy_definition_test.go @@ -60,7 +60,6 @@ resource "sdwan_vpn_list_policy_object" "vpns1" { ] } - resource "sdwan_vpn_membership_policy_definition" "test" { name = "Example" description = "My description" diff --git a/internal/provider/data_source_sdwan_zone_list_policy_object_test.go b/internal/provider/data_source_sdwan_zone_list_policy_object_test.go index f1a07281..2cebc8c9 100644 --- a/internal/provider/data_source_sdwan_zone_list_policy_object_test.go +++ b/internal/provider/data_source_sdwan_zone_list_policy_object_test.go @@ -43,7 +43,6 @@ func TestAccDataSourceSdwanZoneListPolicyObject(t *testing.T) { const testAccDataSourceSdwanZoneListPolicyObjectConfig = ` - resource "sdwan_zone_list_policy_object" "test" { name = "Example" entries = [{ diff --git a/internal/provider/model_sdwan_vedge_inventory.go b/internal/provider/model_sdwan_vedge_inventory.go index d4e37c7a..900c2fa3 100644 --- a/internal/provider/model_sdwan_vedge_inventory.go +++ b/internal/provider/model_sdwan_vedge_inventory.go @@ -29,7 +29,6 @@ import ( type VEdgeInventory struct { Id types.String `tfsdk:"id"` - Name types.String `tfsdk:"name"` Devices []VEdgeInventoryDevices `tfsdk:"devices"` } @@ -44,9 +43,6 @@ type VEdgeInventoryDevices struct { func (data VEdgeInventory) toBody(ctx context.Context) string { body := "" - if !data.Name.IsNull() { - body, _ = sjson.Set(body, "host-name", data.Name.ValueString()) - } if len(data.Devices) > 0 { body, _ = sjson.Set(body, "data", []interface{}{}) for _, item := range data.Devices { @@ -76,11 +72,6 @@ func (data VEdgeInventory) toBody(ctx context.Context) string { } func (data *VEdgeInventory) fromBody(ctx context.Context, res gjson.Result) { - if value := res.Get("host-name"); value.Exists() { - data.Name = types.StringValue(value.String()) - } else { - data.Name = types.StringNull() - } if value := res.Get("data"); value.Exists() { data.Devices = make([]VEdgeInventoryDevices, 0) value.ForEach(func(k, v gjson.Result) bool { @@ -123,9 +114,6 @@ func (data *VEdgeInventory) fromBody(ctx context.Context, res gjson.Result) { func (data *VEdgeInventory) hasChanges(ctx context.Context, state *VEdgeInventory) bool { hasChanges := false - if !data.Name.Equal(state.Name) { - hasChanges = true - } if len(data.Devices) != len(state.Devices) { hasChanges = true } else {