From f86bf9e3c8b28492b1eb746d06c9d20b9d7c36b4 Mon Sep 17 00:00:00 2001 From: Sean Conroy <141843633+seconroy@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:25:46 +0000 Subject: [PATCH] Resolve issue with updating existing entries within policy objects (#360) --- .../profile_parcels/policy_object_app_probe_class.yaml | 3 +-- .../profile_parcels/policy_object_application_list.yaml | 1 + .../profile_parcels/policy_object_as_path_list.yaml | 2 +- .../profile_parcels/policy_object_class_map.yaml | 2 +- .../profile_parcels/policy_object_color_list.yaml | 2 +- .../policy_object_data_ipv4_prefix_list.yaml | 2 +- .../policy_object_data_ipv6_prefix_list.yaml | 2 +- .../policy_object_expanded_community_list.yaml | 2 +- .../policy_object_extended_community_list.yaml | 2 +- .../profile_parcels/policy_object_ipv4_prefix_list.yaml | 3 +-- .../profile_parcels/policy_object_ipv6_prefix_list.yaml | 3 +-- .../profile_parcels/policy_object_mirror.yaml | 3 +-- .../profile_parcels/policy_object_policer.yaml | 4 +--- .../policy_object_preferred_color_group.yaml | 1 + .../policy_object_security_data_ipv4_prefix_list.yaml | 2 +- .../policy_object_security_fqdn_list.yaml | 2 +- .../policy_object_security_geolocation_list.yaml | 1 + .../policy_object_security_identity_list.yaml | 1 + .../policy_object_security_ips_signature.yaml | 3 +-- .../policy_object_security_local_application_list.yaml | 1 + .../policy_object_security_local_domain_list.yaml | 2 +- .../policy_object_security_port_list.yaml | 2 +- .../policy_object_security_scalable_group_tag_list.yaml | 3 +-- .../policy_object_security_url_allow_list.yaml | 2 +- .../policy_object_security_url_block_list.yaml | 2 +- .../profile_parcels/policy_object_sla_class_list.yaml | 1 + .../policy_object_standard_community_list.yaml | 2 +- .../profile_parcels/policy_object_tloc_list.yaml | 1 + .../profile_parcels/policy_object_vpn_group.yaml | 2 +- gen/generator.go | 1 + gen/schema/schema.yaml | 1 + gen/templates/profile_parcels/resource.go | 4 ++++ .../model_sdwan_policy_object_app_probe_class.go | 9 +++++---- .../model_sdwan_policy_object_data_ipv4_prefix_list.go | 7 ++++--- .../model_sdwan_policy_object_data_ipv6_prefix_list.go | 7 ++++--- .../model_sdwan_policy_object_ipv4_prefix_list.go | 6 +++--- .../model_sdwan_policy_object_ipv6_prefix_list.go | 6 +++--- .../resource_sdwan_policy_object_app_probe_class.go | 6 +----- .../resource_sdwan_policy_object_application_list.go | 6 +----- .../resource_sdwan_policy_object_as_path_list.go | 6 +----- .../provider/resource_sdwan_policy_object_class_map.go | 6 +----- .../provider/resource_sdwan_policy_object_color_list.go | 6 +----- ...resource_sdwan_policy_object_data_ipv4_prefix_list.go | 6 +----- ...resource_sdwan_policy_object_data_ipv6_prefix_list.go | 6 +----- ...source_sdwan_policy_object_expanded_community_list.go | 6 +----- ...source_sdwan_policy_object_extended_community_list.go | 6 +----- .../resource_sdwan_policy_object_ipv4_prefix_list.go | 6 +----- .../resource_sdwan_policy_object_ipv6_prefix_list.go | 6 +----- internal/provider/resource_sdwan_policy_object_mirror.go | 6 +----- .../provider/resource_sdwan_policy_object_policer.go | 6 +----- ...resource_sdwan_policy_object_preferred_color_group.go | 6 +----- ...sdwan_policy_object_security_data_ipv4_prefix_list.go | 6 +----- .../resource_sdwan_policy_object_security_fqdn_list.go | 6 +----- ...urce_sdwan_policy_object_security_geolocation_list.go | 6 +----- ...esource_sdwan_policy_object_security_identity_list.go | 6 +----- ...esource_sdwan_policy_object_security_ips_signature.go | 6 +----- ...dwan_policy_object_security_local_application_list.go | 6 +----- ...rce_sdwan_policy_object_security_local_domain_list.go | 6 +----- .../resource_sdwan_policy_object_security_port_list.go | 6 +----- ...wan_policy_object_security_scalable_group_tag_list.go | 6 +----- ...source_sdwan_policy_object_security_url_allow_list.go | 6 +----- ...source_sdwan_policy_object_security_url_block_list.go | 6 +----- .../resource_sdwan_policy_object_sla_class_list.go | 6 +----- ...source_sdwan_policy_object_standard_community_list.go | 6 +----- .../provider/resource_sdwan_policy_object_tloc_list.go | 6 +----- .../provider/resource_sdwan_policy_object_vpn_group.go | 6 +----- 66 files changed, 83 insertions(+), 191 deletions(-) diff --git a/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml index 20f0b300..e4ee9445 100644 --- a/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml +++ b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -20,13 +21,11 @@ attributes: mandatory: true attributes: - model_name: color - id: true mandatory: true example: 3g - model_name: dscp example: 45 - model_name: forwardingClass - id: true mandatory: true example: classlist1 diff --git a/gen/definitions/profile_parcels/policy_object_application_list.yaml b/gen/definitions/profile_parcels/policy_object_application_list.yaml index 5c3a247d..a366f64b 100644 --- a/gen/definitions/profile_parcels/policy_object_application_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_application_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_as_path_list.yaml b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml index 80e6e2fa..810b994e 100644 --- a/gen/definitions/profile_parcels/policy_object_as_path_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -22,7 +23,6 @@ attributes: attributes: - model_name: asPath tf_name: as_path_list - id: true mandatory: true example: 110 diff --git a/gen/definitions/profile_parcels/policy_object_class_map.yaml b/gen/definitions/profile_parcels/policy_object_class_map.yaml index 647b9141..c865b675 100644 --- a/gen/definitions/profile_parcels/policy_object_class_map.yaml +++ b/gen/definitions/profile_parcels/policy_object_class_map.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: queue - id: true mandatory: true example: 0 diff --git a/gen/definitions/profile_parcels/policy_object_color_list.yaml b/gen/definitions/profile_parcels/policy_object_color_list.yaml index 5a4379f9..4962f92c 100644 --- a/gen/definitions/profile_parcels/policy_object_color_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_color_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: color - id: true mandatory: true example: blue diff --git a/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml index 2a3b2826..8661059b 100644 --- a/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_data_ipv4_prefix_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: ipv4Address - id: true mandatory: true example: 10.0.0.0 - model_name: ipv4PrefixLength diff --git a/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml index 90c5620c..0e23ae31 100644 --- a/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_data_ipv6_prefix_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: ipv6Address - id: true mandatory: true example: 2001:db8:85a3::8a2e:370:7334 - model_name: ipv6PrefixLength diff --git a/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml b/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml index 7a4ea8db..858450d3 100644 --- a/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_expanded_community_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -15,7 +16,6 @@ attributes: test_value: sdwan_policy_object_feature_profile.test.id - model_name: expandedCommunityList tf_name: expanded_community_lists - id: true mandatory: true example: abcd diff --git a/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml b/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml index 938db6aa..5369aae7 100644 --- a/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_extended_community_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,7 +19,6 @@ attributes: attributes: - model_name: extCommunity tf_name: extended_community - id: true mandatory: true example: "soo 10.0.0.1:30" diff --git a/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml index 139a9200..8deebfa9 100644 --- a/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_ipv4_prefix_list.yaml @@ -4,6 +4,7 @@ rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/prefix minimum_version: 20.12.0 test_tags: [SDWAN_2012] parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -16,12 +17,10 @@ attributes: mandatory: true attributes: - model_name: ipv4Address - id: true mandatory: true example: 10.0.0.0 minimum_test_value: '"10.0.0.0"' - model_name: ipv4PrefixLength - id: true mandatory: true example: 8 minimum_test_value: "8" diff --git a/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml index 9ba31c2b..b1b27f8a 100644 --- a/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_ipv6_prefix_list.yaml @@ -4,6 +4,7 @@ rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/ipv6-prefix minimum_version: 20.12.0 test_tags: [SDWAN_2012] parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -16,12 +17,10 @@ attributes: mandatory: true attributes: - model_name: ipv6Address - id: true mandatory: true example: 2001:db8:85a3::8a2e:370:7334 minimum_test_value: '"2001:db8:85a3::8a2e:370:7334"' - model_name: ipv6PrefixLength - id: true mandatory: true example: 64 minimum_test_value: "64" diff --git a/gen/definitions/profile_parcels/policy_object_mirror.yaml b/gen/definitions/profile_parcels/policy_object_mirror.yaml index 0315abe9..dffc878c 100644 --- a/gen/definitions/profile_parcels/policy_object_mirror.yaml +++ b/gen/definitions/profile_parcels/policy_object_mirror.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,12 +19,10 @@ attributes: attributes: - model_name: remoteDestIp tf_name: remote_destination_ip - id: true mandatory: true example: 10.0.0.1 - model_name: sourceIp tf_name: source_ip - id: true mandatory: true example: 10.0.0.2 diff --git a/gen/definitions/profile_parcels/policy_object_policer.yaml b/gen/definitions/profile_parcels/policy_object_policer.yaml index 8de5df5d..63eef04f 100644 --- a/gen/definitions/profile_parcels/policy_object_policer.yaml +++ b/gen/definitions/profile_parcels/policy_object_policer.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,17 +19,14 @@ attributes: attributes: - model_name: burst tf_name: burst_bytes - id: true mandatory: true example: 56500 - model_name: exceed tf_name: exceed_action - id: true mandatory: true example: remark - model_name: rate tf_name: rate_bps - id: true mandatory: true example: 60000 diff --git a/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml b/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml index a3f612b8..3a0bf0b9 100644 --- a/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml +++ b/gen/definitions/profile_parcels/policy_object_preferred_color_group.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml index 4cb3bf6a..51af119d 100644 --- a/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: ipPrefix - id: true mandatory: true example: 10.0.0.0/12 diff --git a/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml index 500ce933..112649b0 100644 --- a/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: pattern - id: true mandatory: true example: cisco.com diff --git a/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml index d8593702..8678df63 100644 --- a/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml index 67d8f999..29f7696c 100644 --- a/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml b/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml index 2388f6d6..a92723bd 100644 --- a/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] parcel_type: policy_object skip_minimum_test: true +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,11 +18,9 @@ attributes: mandatory: true attributes: - model_name: generatorId - id: true mandatory: true example: 1234 - model_name: signatureId - id: true mandatory: true example: 5678 diff --git a/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml index ef6e50a8..9d38f951 100644 --- a/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml index b67b9dbe..d105e759 100644 --- a/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,7 +19,6 @@ attributes: attributes: - model_name: nameServer tf_name: local_domain - id: true mandatory: true example: hello.com diff --git a/gen/definitions/profile_parcels/policy_object_security_port_list.yaml b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml index 200cdc25..f634ec3f 100644 --- a/gen/definitions/profile_parcels/policy_object_security_port_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: port - id: true mandatory: true example: 100 diff --git a/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml index 3d753e81..598b1dbc 100644 --- a/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -16,11 +17,9 @@ attributes: mandatory: true attributes: - model_name: sgtName - id: true mandatory: true example: ANY - model_name: tag - id: true mandatory: true example: 65535 diff --git a/gen/definitions/profile_parcels/policy_object_security_url_allow_list.yaml b/gen/definitions/profile_parcels/policy_object_security_url_allow_list.yaml index a74e2060..4477886c 100644 --- a/gen/definitions/profile_parcels/policy_object_security_url_allow_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_url_allow_list.yaml @@ -6,6 +6,7 @@ test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object type_value: urlallowed +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,7 +19,6 @@ attributes: mandatory: true attributes: - model_name: pattern - id: true mandatory: true example: www.cisco.com diff --git a/gen/definitions/profile_parcels/policy_object_security_url_block_list.yaml b/gen/definitions/profile_parcels/policy_object_security_url_block_list.yaml index 0f744647..566018d2 100644 --- a/gen/definitions/profile_parcels/policy_object_security_url_block_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_url_block_list.yaml @@ -6,6 +6,7 @@ test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object type_value: urlblocked +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -18,7 +19,6 @@ attributes: mandatory: true attributes: - model_name: pattern - id: true mandatory: true example: www.cisco.com diff --git a/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml b/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml index 2dc3bd43..86a28c0d 100644 --- a/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_sla_class_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml index 9970b996..6cc75291 100644 --- a/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: standardCommunity - id: true mandatory: true example: 1000:10000 diff --git a/gen/definitions/profile_parcels/policy_object_tloc_list.yaml b/gen/definitions/profile_parcels/policy_object_tloc_list.yaml index dcf37750..2eb90338 100644 --- a/gen/definitions/profile_parcels/policy_object_tloc_list.yaml +++ b/gen/definitions/profile_parcels/policy_object_tloc_list.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true diff --git a/gen/definitions/profile_parcels/policy_object_vpn_group.yaml b/gen/definitions/profile_parcels/policy_object_vpn_group.yaml index 27887d7b..b00f5451 100644 --- a/gen/definitions/profile_parcels/policy_object_vpn_group.yaml +++ b/gen/definitions/profile_parcels/policy_object_vpn_group.yaml @@ -5,6 +5,7 @@ minimum_version: 20.12.0 test_tags: [SDWAN_2012] skip_minimum_test: true parcel_type: policy_object +full_update: true attributes: - tf_name: feature_profile_id reference: true @@ -17,7 +18,6 @@ attributes: mandatory: true attributes: - model_name: vpn - id: true mandatory: true example: 100 diff --git a/gen/generator.go b/gen/generator.go index f572af2b..be587089 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -213,6 +213,7 @@ type YamlConfig struct { GetBeforeDelete bool `yaml:"get_before_delete"` DeleteMutex bool `yaml:"delete_mutex"` ParcelType string `yaml:"parcel_type"` + FullUpdate bool `yaml:"full_update"` } type YamlConfigAttribute struct { diff --git a/gen/schema/schema.yaml b/gen/schema/schema.yaml index 7b7f9be9..edaad614 100644 --- a/gen/schema/schema.yaml +++ b/gen/schema/schema.yaml @@ -27,6 +27,7 @@ get_before_delete: bool(required=False) # This does a GET "all" before doing a D delete_mutex: bool(required=False) # Set to true if DELETE operation is mutually exclusive with other DELETE operations skip_minimum_test: bool(required=False) # Set to true to prevent "minimum" resource acceptance testing parcel_type: enum('feature', 'policy', 'policy_object', required=False) # Type of profile parcel +full_update: bool(required=False) # Set to true to exclude updateFromBody and just use updateBody within update method --- attribute: model_name: str(required=False) # Name of the attribute in the model (payload) diff --git a/gen/templates/profile_parcels/resource.go b/gen/templates/profile_parcels/resource.go index 684361b1..e6318835 100644 --- a/gen/templates/profile_parcels/resource.go +++ b/gen/templates/profile_parcels/resource.go @@ -447,11 +447,15 @@ func (r *{{camelCase .Name}}ProfileParcelResource) Read(ctx context.Context, req } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes + {{- if not .FullUpdate}} if state.isNull(ctx, res) { state.fromBody(ctx, res) } else { state.updateFromBody(ctx, res) } + {{- else}} + state.fromBody(ctx, res) + {{- end}} if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/model_sdwan_policy_object_app_probe_class.go b/internal/provider/model_sdwan_policy_object_app_probe_class.go index 4ae2ec03..61e2da31 100644 --- a/internal/provider/model_sdwan_policy_object_app_probe_class.go +++ b/internal/provider/model_sdwan_policy_object_app_probe_class.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "net/url" + "strconv" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/tidwall/gjson" @@ -174,7 +175,7 @@ func (data *PolicyObjectAppProbeClass) updateFromBody(ctx context.Context, res g for i := range data.Entries { keys := [...]string{"forwardingClass"} keyValues := [...]string{data.Entries[i].ForwardingClass.ValueString()} - keyValuesVariables := [...]string{""} + keyValuesVariables := [...]string{"", ""} var r gjson.Result res.Get(path + "entries").ForEach( @@ -201,9 +202,9 @@ func (data *PolicyObjectAppProbeClass) updateFromBody(ctx context.Context, res g }, ) for ci := range data.Entries[i].Map { - keys := [...]string{"color"} - keyValues := [...]string{data.Entries[i].Map[ci].Color.ValueString()} - keyValuesVariables := [...]string{""} + keys := [...]string{"color", "dscp"} + keyValues := [...]string{data.Entries[i].Map[ci].Color.ValueString(), strconv.FormatInt(data.Entries[i].Map[ci].Dscp.ValueInt64(), 10)} + keyValuesVariables := [...]string{"", ""} var cr gjson.Result r.Get("map").ForEach( diff --git a/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go b/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go index b89830ed..d5fb0015 100644 --- a/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go +++ b/internal/provider/model_sdwan_policy_object_data_ipv4_prefix_list.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "net/url" + "strconv" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/tidwall/gjson" @@ -138,9 +139,9 @@ func (data *PolicyObjectDataIPv4PrefixList) updateFromBody(ctx context.Context, } path := "payload.data." for i := range data.Entries { - keys := [...]string{"ipv4Address"} - keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString()} - keyValuesVariables := [...]string{""} + keys := [...]string{"ipv4Address", "ipv4PrefixLength"} + keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv4PrefixLength.ValueInt64(), 10)} + keyValuesVariables := [...]string{"", ""} var r gjson.Result res.Get(path + "entries").ForEach( diff --git a/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go b/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go index dc181a92..496d0571 100644 --- a/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go +++ b/internal/provider/model_sdwan_policy_object_data_ipv6_prefix_list.go @@ -22,6 +22,7 @@ import ( "context" "fmt" "net/url" + "strconv" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/tidwall/gjson" @@ -138,9 +139,9 @@ func (data *PolicyObjectDataIPv6PrefixList) updateFromBody(ctx context.Context, } path := "payload.data." for i := range data.Entries { - keys := [...]string{"ipv6Address"} - keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString()} - keyValuesVariables := [...]string{""} + keys := [...]string{"ipv6Address", "ipv6PrefixLength"} + keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv6PrefixLength.ValueInt64(), 10)} + keyValuesVariables := [...]string{"", ""} var r gjson.Result res.Get(path + "entries").ForEach( diff --git a/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go b/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go index 04b01a6d..6e49a40c 100644 --- a/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go +++ b/internal/provider/model_sdwan_policy_object_ipv4_prefix_list.go @@ -169,9 +169,9 @@ func (data *PolicyObjectIPv4PrefixList) updateFromBody(ctx context.Context, res } path := "payload.data." for i := range data.Entries { - keys := [...]string{"ipv4Address", "ipv4PrefixLength"} - keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv4PrefixLength.ValueInt64(), 10)} - keyValuesVariables := [...]string{"", ""} + keys := [...]string{"ipv4Address", "ipv4PrefixLength", "leRangePrefixLength", "geRangePrefixLength"} + keyValues := [...]string{data.Entries[i].Ipv4Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv4PrefixLength.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Le.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Ge.ValueInt64(), 10)} + keyValuesVariables := [...]string{"", "", "", ""} var r gjson.Result res.Get(path + "entries").ForEach( diff --git a/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go b/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go index b73b0b72..80425a52 100644 --- a/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go +++ b/internal/provider/model_sdwan_policy_object_ipv6_prefix_list.go @@ -169,9 +169,9 @@ func (data *PolicyObjectIPv6PrefixList) updateFromBody(ctx context.Context, res } path := "payload.data." for i := range data.Entries { - keys := [...]string{"ipv6Address", "ipv6PrefixLength"} - keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv6PrefixLength.ValueInt64(), 10)} - keyValuesVariables := [...]string{"", ""} + keys := [...]string{"ipv6Address", "ipv6PrefixLength", "leRangePrefixLength", "geRangePrefixLength"} + keyValues := [...]string{data.Entries[i].Ipv6Address.ValueString(), strconv.FormatInt(data.Entries[i].Ipv6PrefixLength.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Le.ValueInt64(), 10), strconv.FormatInt(data.Entries[i].Ge.ValueInt64(), 10)} + keyValuesVariables := [...]string{"", "", "", ""} var r gjson.Result res.Get(path + "entries").ForEach( diff --git a/internal/provider/resource_sdwan_policy_object_app_probe_class.go b/internal/provider/resource_sdwan_policy_object_app_probe_class.go index cbc3701d..8053375b 100644 --- a/internal/provider/resource_sdwan_policy_object_app_probe_class.go +++ b/internal/provider/resource_sdwan_policy_object_app_probe_class.go @@ -194,11 +194,7 @@ func (r *PolicyObjectAppProbeClassProfileParcelResource) Read(ctx context.Contex } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_application_list.go b/internal/provider/resource_sdwan_policy_object_application_list.go index a11436cd..9d2d82d3 100644 --- a/internal/provider/resource_sdwan_policy_object_application_list.go +++ b/internal/provider/resource_sdwan_policy_object_application_list.go @@ -173,11 +173,7 @@ func (r *PolicyObjectApplicationListProfileParcelResource) Read(ctx context.Cont } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_as_path_list.go b/internal/provider/resource_sdwan_policy_object_as_path_list.go index 4c8f6f25..75f15364 100644 --- a/internal/provider/resource_sdwan_policy_object_as_path_list.go +++ b/internal/provider/resource_sdwan_policy_object_as_path_list.go @@ -183,11 +183,7 @@ func (r *PolicyObjectASPathListProfileParcelResource) Read(ctx context.Context, } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_class_map.go b/internal/provider/resource_sdwan_policy_object_class_map.go index bf14df35..3c39ae10 100644 --- a/internal/provider/resource_sdwan_policy_object_class_map.go +++ b/internal/provider/resource_sdwan_policy_object_class_map.go @@ -174,11 +174,7 @@ func (r *PolicyObjectClassMapProfileParcelResource) Read(ctx context.Context, re } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_color_list.go b/internal/provider/resource_sdwan_policy_object_color_list.go index f2a5874e..b429a9af 100644 --- a/internal/provider/resource_sdwan_policy_object_color_list.go +++ b/internal/provider/resource_sdwan_policy_object_color_list.go @@ -174,11 +174,7 @@ func (r *PolicyObjectColorListProfileParcelResource) Read(ctx context.Context, r } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go index 37403ea8..3bbc8fa3 100644 --- a/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go +++ b/internal/provider/resource_sdwan_policy_object_data_ipv4_prefix_list.go @@ -178,11 +178,7 @@ func (r *PolicyObjectDataIPv4PrefixListProfileParcelResource) Read(ctx context.C } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go index 0ebf8f82..0a42def7 100644 --- a/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go +++ b/internal/provider/resource_sdwan_policy_object_data_ipv6_prefix_list.go @@ -178,11 +178,7 @@ func (r *PolicyObjectDataIPv6PrefixListProfileParcelResource) Read(ctx context.C } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_expanded_community_list.go b/internal/provider/resource_sdwan_policy_object_expanded_community_list.go index a27f43ef..3dbbe0db 100644 --- a/internal/provider/resource_sdwan_policy_object_expanded_community_list.go +++ b/internal/provider/resource_sdwan_policy_object_expanded_community_list.go @@ -166,11 +166,7 @@ func (r *PolicyObjectExpandedCommunityListProfileParcelResource) Read(ctx contex } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_extended_community_list.go b/internal/provider/resource_sdwan_policy_object_extended_community_list.go index 57ba46d3..0ec12f8d 100644 --- a/internal/provider/resource_sdwan_policy_object_extended_community_list.go +++ b/internal/provider/resource_sdwan_policy_object_extended_community_list.go @@ -175,11 +175,7 @@ func (r *PolicyObjectExtendedCommunityListProfileParcelResource) Read(ctx contex } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go index ed6e463a..a5c91408 100644 --- a/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go +++ b/internal/provider/resource_sdwan_policy_object_ipv4_prefix_list.go @@ -192,11 +192,7 @@ func (r *PolicyObjectIPv4PrefixListProfileParcelResource) Read(ctx context.Conte } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go index 5c351041..c2ed9345 100644 --- a/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go +++ b/internal/provider/resource_sdwan_policy_object_ipv6_prefix_list.go @@ -192,11 +192,7 @@ func (r *PolicyObjectIPv6PrefixListProfileParcelResource) Read(ctx context.Conte } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_mirror.go b/internal/provider/resource_sdwan_policy_object_mirror.go index 8a9381bc..9db6fd3c 100644 --- a/internal/provider/resource_sdwan_policy_object_mirror.go +++ b/internal/provider/resource_sdwan_policy_object_mirror.go @@ -173,11 +173,7 @@ func (r *PolicyObjectMirrorProfileParcelResource) Read(ctx context.Context, req } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_policer.go b/internal/provider/resource_sdwan_policy_object_policer.go index ca374011..ff711a97 100644 --- a/internal/provider/resource_sdwan_policy_object_policer.go +++ b/internal/provider/resource_sdwan_policy_object_policer.go @@ -189,11 +189,7 @@ func (r *PolicyObjectPolicerProfileParcelResource) Read(ctx context.Context, req } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_preferred_color_group.go b/internal/provider/resource_sdwan_policy_object_preferred_color_group.go index 46315015..f79fd064 100644 --- a/internal/provider/resource_sdwan_policy_object_preferred_color_group.go +++ b/internal/provider/resource_sdwan_policy_object_preferred_color_group.go @@ -203,11 +203,7 @@ func (r *PolicyObjectPreferredColorGroupProfileParcelResource) Read(ctx context. } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go index b1ed0b6a..d781ec68 100644 --- a/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list.go @@ -179,11 +179,7 @@ func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Read(ctx c } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go b/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go index bd2403f7..3cf0d5f1 100644 --- a/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_fqdn_list.go @@ -176,11 +176,7 @@ func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Read(ctx context.Con } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go b/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go index 9dec0e02..b486b268 100644 --- a/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_geolocation_list.go @@ -181,11 +181,7 @@ func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Read(ctx cont } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_identity_list.go b/internal/provider/resource_sdwan_policy_object_security_identity_list.go index 0676236d..51fe81c2 100644 --- a/internal/provider/resource_sdwan_policy_object_security_identity_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_identity_list.go @@ -184,11 +184,7 @@ func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Read(ctx context } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_ips_signature.go b/internal/provider/resource_sdwan_policy_object_security_ips_signature.go index 60e848f1..32d30e09 100644 --- a/internal/provider/resource_sdwan_policy_object_security_ips_signature.go +++ b/internal/provider/resource_sdwan_policy_object_security_ips_signature.go @@ -182,11 +182,7 @@ func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Read(ctx context } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_local_application_list.go b/internal/provider/resource_sdwan_policy_object_security_local_application_list.go index 45a9c278..3926766f 100644 --- a/internal/provider/resource_sdwan_policy_object_security_local_application_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_local_application_list.go @@ -173,11 +173,7 @@ func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Read(ctx } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go b/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go index 2a6b5796..2e4200d1 100644 --- a/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_local_domain_list.go @@ -176,11 +176,7 @@ func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Read(ctx cont } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_port_list.go b/internal/provider/resource_sdwan_policy_object_security_port_list.go index a4ff5633..f43d3872 100644 --- a/internal/provider/resource_sdwan_policy_object_security_port_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_port_list.go @@ -169,11 +169,7 @@ func (r *PolicyObjectSecurityPortListProfileParcelResource) Read(ctx context.Con } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go index f5e6abe1..eef06e83 100644 --- a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list.go @@ -181,11 +181,7 @@ func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Read(ctx } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_url_allow_list.go b/internal/provider/resource_sdwan_policy_object_security_url_allow_list.go index c7fcccef..de3992d9 100644 --- a/internal/provider/resource_sdwan_policy_object_security_url_allow_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_url_allow_list.go @@ -176,11 +176,7 @@ func (r *PolicyObjectSecurityURLAllowListProfileParcelResource) Read(ctx context } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_security_url_block_list.go b/internal/provider/resource_sdwan_policy_object_security_url_block_list.go index e8ca71ba..0eb70ef6 100644 --- a/internal/provider/resource_sdwan_policy_object_security_url_block_list.go +++ b/internal/provider/resource_sdwan_policy_object_security_url_block_list.go @@ -176,11 +176,7 @@ func (r *PolicyObjectSecurityURLBlockListProfileParcelResource) Read(ctx context } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_sla_class_list.go b/internal/provider/resource_sdwan_policy_object_sla_class_list.go index b74f246b..b330235f 100644 --- a/internal/provider/resource_sdwan_policy_object_sla_class_list.go +++ b/internal/provider/resource_sdwan_policy_object_sla_class_list.go @@ -225,11 +225,7 @@ func (r *PolicyObjectSLAClassListProfileParcelResource) Read(ctx context.Context } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_standard_community_list.go b/internal/provider/resource_sdwan_policy_object_standard_community_list.go index b0e9ad66..a869789c 100644 --- a/internal/provider/resource_sdwan_policy_object_standard_community_list.go +++ b/internal/provider/resource_sdwan_policy_object_standard_community_list.go @@ -169,11 +169,7 @@ func (r *PolicyObjectStandardCommunityListProfileParcelResource) Read(ctx contex } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_tloc_list.go b/internal/provider/resource_sdwan_policy_object_tloc_list.go index 4f30f29f..2e967d09 100644 --- a/internal/provider/resource_sdwan_policy_object_tloc_list.go +++ b/internal/provider/resource_sdwan_policy_object_tloc_list.go @@ -189,11 +189,7 @@ func (r *PolicyObjectTLOCListProfileParcelResource) Read(ctx context.Context, re } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) } diff --git a/internal/provider/resource_sdwan_policy_object_vpn_group.go b/internal/provider/resource_sdwan_policy_object_vpn_group.go index ae42857e..a2a6ceed 100644 --- a/internal/provider/resource_sdwan_policy_object_vpn_group.go +++ b/internal/provider/resource_sdwan_policy_object_vpn_group.go @@ -169,11 +169,7 @@ func (r *PolicyObjectVPNGroupProfileParcelResource) Read(ctx context.Context, re } // If every attribute is set to null we are dealing with an import operation and therefore reading all attributes - if state.isNull(ctx, res) { - state.fromBody(ctx, res) - } else { - state.updateFromBody(ctx, res) - } + state.fromBody(ctx, res) if state.Version.IsNull() { state.Version = types.Int64Value(0) }