diff --git a/CHANGELOG.md b/CHANGELOG.md index 1432463e8..945d7981d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,21 +38,21 @@ - Add `sdwan_service_switchport_profile_parcel` resource and data source - Add `sdwan_transport_route_policy_profile_parcel` resource and data source - Add `sdwan_service_route_policy_profile_parcel` resource and data source -- Add `sdwan_policy_object_app_probe_profile_parcel` resource and data source -- Add `sdwan_policy_object_as_path_profile_parcel` resource and data source +- Add `sdwan_policy_object_app_probe_class_profile_parcel` resource and data source +- Add `sdwan_policy_object_as_path_list_profile_parcel` resource and data source - Add `sdwan_policy_object_vpn_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_data_ip_prefix_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_fqdn_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_geolocation_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_fqdn_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_geolocation_list_profile_parcel` resource and data source - Add `sdwan_policy_object_security_ips_signature_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localdomain_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_port_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_scalable_group_tag_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_urllist_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_domain_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_port_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_scalable_group_tag_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_url_list_profile_parcel` resource and data source - Add `sdwan_policy_object_preferred_color_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_identity_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localapp_profile_parcel` resource and data source -- Add `sdwan_policy_object_standard_community_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_identity_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_application_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_standard_community_list_profile_parcel` resource and data source ## 0.3.13 diff --git a/docs/data-sources/policy_object_app_probe_profile_parcel.md b/docs/data-sources/policy_object_app_probe_class_profile_parcel.md similarity index 73% rename from docs/data-sources/policy_object_app_probe_profile_parcel.md rename to docs/data-sources/policy_object_app_probe_class_profile_parcel.md index c304e1d50..d2e9a8554 100644 --- a/docs/data-sources/policy_object_app_probe_profile_parcel.md +++ b/docs/data-sources/policy_object_app_probe_class_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_app_probe_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_app_probe_class_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object App Probe profile parcel. + This data source can read the Policy Object App Probe Class profile parcel. --- -# sdwan_policy_object_app_probe_profile_parcel (Data Source) +# sdwan_policy_object_app_probe_class_profile_parcel (Data Source) -This data source can read the Policy Object App Probe profile parcel. +This data source can read the Policy Object App Probe Class profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_app_probe_profile_parcel" "example" { +data "sdwan_policy_object_app_probe_class_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_as_path_profile_parcel.md b/docs/data-sources/policy_object_as_path_list_profile_parcel.md similarity index 69% rename from docs/data-sources/policy_object_as_path_profile_parcel.md rename to docs/data-sources/policy_object_as_path_list_profile_parcel.md index 4ad01e7a8..7cd1f7637 100644 --- a/docs/data-sources/policy_object_as_path_profile_parcel.md +++ b/docs/data-sources/policy_object_as_path_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_as_path_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_as_path_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object AS Path profile parcel. + This data source can read the Policy Object AS Path List profile parcel. --- -# sdwan_policy_object_as_path_profile_parcel (Data Source) +# sdwan_policy_object_as_path_list_profile_parcel (Data Source) -This data source can read the Policy Object AS Path profile parcel. +This data source can read the Policy Object AS Path List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_as_path_profile_parcel" "example" { +data "sdwan_policy_object_as_path_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_data_ip_prefix_profile_parcel.md b/docs/data-sources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md similarity index 64% rename from docs/data-sources/policy_object_security_data_ip_prefix_profile_parcel.md rename to docs/data-sources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md index c357240f7..bf007e8c4 100644 --- a/docs/data-sources/policy_object_security_data_ip_prefix_profile_parcel.md +++ b/docs/data-sources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_data_ip_prefix_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Data IP Prefix profile parcel. + This data source can read the Policy Object Security Data IPv4 Prefix List profile parcel. --- -# sdwan_policy_object_security_data_ip_prefix_profile_parcel (Data Source) +# sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Data IP Prefix profile parcel. +This data source can read the Policy Object Security Data IPv4 Prefix List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "example" { +data "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_fqdn_profile_parcel.md b/docs/data-sources/policy_object_security_fqdn_list_profile_parcel.md similarity index 66% rename from docs/data-sources/policy_object_security_fqdn_profile_parcel.md rename to docs/data-sources/policy_object_security_fqdn_list_profile_parcel.md index b25ce0e01..99878ecb0 100644 --- a/docs/data-sources/policy_object_security_fqdn_profile_parcel.md +++ b/docs/data-sources/policy_object_security_fqdn_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_fqdn_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_fqdn_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security FQDN profile parcel. + This data source can read the Policy Object Security FQDN List profile parcel. --- -# sdwan_policy_object_security_fqdn_profile_parcel (Data Source) +# sdwan_policy_object_security_fqdn_list_profile_parcel (Data Source) -This data source can read the Policy Object Security FQDN profile parcel. +This data source can read the Policy Object Security FQDN List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_fqdn_profile_parcel" "example" { +data "sdwan_policy_object_security_fqdn_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_geolocation_profile_parcel.md b/docs/data-sources/policy_object_security_geolocation_list_profile_parcel.md similarity index 76% rename from docs/data-sources/policy_object_security_geolocation_profile_parcel.md rename to docs/data-sources/policy_object_security_geolocation_list_profile_parcel.md index 170e7c5b6..eda5780c4 100644 --- a/docs/data-sources/policy_object_security_geolocation_profile_parcel.md +++ b/docs/data-sources/policy_object_security_geolocation_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_geolocation_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_geolocation_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Geolocation profile parcel. + This data source can read the Policy Object Security Geolocation List profile parcel. --- -# sdwan_policy_object_security_geolocation_profile_parcel (Data Source) +# sdwan_policy_object_security_geolocation_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Geolocation profile parcel. +This data source can read the Policy Object Security Geolocation List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_geolocation_profile_parcel" "example" { +data "sdwan_policy_object_security_geolocation_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_identity_profile_parcel.md b/docs/data-sources/policy_object_security_identity_list_profile_parcel.md similarity index 71% rename from docs/data-sources/policy_object_security_identity_profile_parcel.md rename to docs/data-sources/policy_object_security_identity_list_profile_parcel.md index 47966622e..a974d61f4 100644 --- a/docs/data-sources/policy_object_security_identity_profile_parcel.md +++ b/docs/data-sources/policy_object_security_identity_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_identity_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_identity_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Identity profile parcel. + This data source can read the Policy Object Security Identity List profile parcel. --- -# sdwan_policy_object_security_identity_profile_parcel (Data Source) +# sdwan_policy_object_security_identity_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Identity profile parcel. +This data source can read the Policy Object Security Identity List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_identity_profile_parcel" "example" { +data "sdwan_policy_object_security_identity_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_ips_signature_profile_parcel.md b/docs/data-sources/policy_object_security_ips_signature_profile_parcel.md index f905e178a..59617f089 100644 --- a/docs/data-sources/policy_object_security_ips_signature_profile_parcel.md +++ b/docs/data-sources/policy_object_security_ips_signature_profile_parcel.md @@ -3,12 +3,12 @@ page_title: "sdwan_policy_object_security_ips_signature_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security IPs Signature profile parcel. + This data source can read the Policy Object Security IPS Signature profile parcel. --- # sdwan_policy_object_security_ips_signature_profile_parcel (Data Source) -This data source can read the Policy Object Security IPs Signature profile parcel. +This data source can read the Policy Object Security IPS Signature profile parcel. ## Example Usage diff --git a/docs/data-sources/policy_object_security_localapp_profile_parcel.md b/docs/data-sources/policy_object_security_local_application_list_profile_parcel.md similarity index 64% rename from docs/data-sources/policy_object_security_localapp_profile_parcel.md rename to docs/data-sources/policy_object_security_local_application_list_profile_parcel.md index a070f2252..cf9fcb115 100644 --- a/docs/data-sources/policy_object_security_localapp_profile_parcel.md +++ b/docs/data-sources/policy_object_security_local_application_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_localapp_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_local_application_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Localapp profile parcel. + This data source can read the Policy Object Security Local Application List profile parcel. --- -# sdwan_policy_object_security_localapp_profile_parcel (Data Source) +# sdwan_policy_object_security_local_application_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Localapp profile parcel. +This data source can read the Policy Object Security Local Application List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_localapp_profile_parcel" "example" { +data "sdwan_policy_object_security_local_application_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_localdomain_profile_parcel.md b/docs/data-sources/policy_object_security_local_domain_list_profile_parcel.md similarity index 62% rename from docs/data-sources/policy_object_security_localdomain_profile_parcel.md rename to docs/data-sources/policy_object_security_local_domain_list_profile_parcel.md index 0448fd0e8..6d1db8b2f 100644 --- a/docs/data-sources/policy_object_security_localdomain_profile_parcel.md +++ b/docs/data-sources/policy_object_security_local_domain_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_localdomain_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_local_domain_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Localdomain profile parcel. + This data source can read the Policy Object Security Local Domain List profile parcel. --- -# sdwan_policy_object_security_localdomain_profile_parcel (Data Source) +# sdwan_policy_object_security_local_domain_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Localdomain profile parcel. +This data source can read the Policy Object Security Local Domain List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_localdomain_profile_parcel" "example" { +data "sdwan_policy_object_security_local_domain_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } @@ -39,4 +39,4 @@ data "sdwan_policy_object_security_localdomain_profile_parcel" "example" { Read-Only: -- `name_server` (String) +- `local_domain` (String) diff --git a/docs/data-sources/policy_object_security_port_profile_parcel.md b/docs/data-sources/policy_object_security_port_list_profile_parcel.md similarity index 67% rename from docs/data-sources/policy_object_security_port_profile_parcel.md rename to docs/data-sources/policy_object_security_port_list_profile_parcel.md index 6ed681704..16d813784 100644 --- a/docs/data-sources/policy_object_security_port_profile_parcel.md +++ b/docs/data-sources/policy_object_security_port_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_port_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_port_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Port profile parcel. + This data source can read the Policy Object Security Port List profile parcel. --- -# sdwan_policy_object_security_port_profile_parcel (Data Source) +# sdwan_policy_object_security_port_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Port profile parcel. +This data source can read the Policy Object Security Port List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_port_profile_parcel" "example" { +data "sdwan_policy_object_security_port_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_security_scalable_group_tag_profile_parcel.md b/docs/data-sources/policy_object_security_scalable_group_tag_list_profile_parcel.md similarity index 72% rename from docs/data-sources/policy_object_security_scalable_group_tag_profile_parcel.md rename to docs/data-sources/policy_object_security_scalable_group_tag_list_profile_parcel.md index 06fb5aa6a..45eaf7621 100644 --- a/docs/data-sources/policy_object_security_scalable_group_tag_profile_parcel.md +++ b/docs/data-sources/policy_object_security_scalable_group_tag_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_scalable_group_tag_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security Scalable Group Tag profile parcel. + This data source can read the Policy Object Security Scalable Group Tag List profile parcel. --- -# sdwan_policy_object_security_scalable_group_tag_profile_parcel (Data Source) +# sdwan_policy_object_security_scalable_group_tag_list_profile_parcel (Data Source) -This data source can read the Policy Object Security Scalable Group Tag profile parcel. +This data source can read the Policy Object Security Scalable Group Tag List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "example" { +data "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "" } diff --git a/docs/data-sources/policy_object_security_urllist_profile_parcel.md b/docs/data-sources/policy_object_security_url_list_profile_parcel.md similarity index 67% rename from docs/data-sources/policy_object_security_urllist_profile_parcel.md rename to docs/data-sources/policy_object_security_url_list_profile_parcel.md index ee867223d..4c614028d 100644 --- a/docs/data-sources/policy_object_security_urllist_profile_parcel.md +++ b/docs/data-sources/policy_object_security_url_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_urllist_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_url_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Security URLlist profile parcel. + This data source can read the Policy Object Security URL List profile parcel. --- -# sdwan_policy_object_security_urllist_profile_parcel (Data Source) +# sdwan_policy_object_security_url_list_profile_parcel (Data Source) -This data source can read the Policy Object Security URLlist profile parcel. +This data source can read the Policy Object Security URL List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_security_urllist_profile_parcel" "example" { +data "sdwan_policy_object_security_url_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/data-sources/policy_object_standard_community_profile_parcel.md b/docs/data-sources/policy_object_standard_community_list_profile_parcel.md similarity index 71% rename from docs/data-sources/policy_object_standard_community_profile_parcel.md rename to docs/data-sources/policy_object_standard_community_list_profile_parcel.md index d9b9b7e0e..5fb4387d2 100644 --- a/docs/data-sources/policy_object_standard_community_profile_parcel.md +++ b/docs/data-sources/policy_object_standard_community_list_profile_parcel.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_standard_community_profile_parcel Data Source - terraform-provider-sdwan" +page_title: "sdwan_policy_object_standard_community_list_profile_parcel Data Source - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This data source can read the Policy Object Standard Community profile parcel. + This data source can read the Policy Object Standard Community List profile parcel. --- -# sdwan_policy_object_standard_community_profile_parcel (Data Source) +# sdwan_policy_object_standard_community_list_profile_parcel (Data Source) -This data source can read the Policy Object Standard Community profile parcel. +This data source can read the Policy Object Standard Community List profile parcel. ## Example Usage ```terraform -data "sdwan_policy_object_standard_community_profile_parcel" "example" { +data "sdwan_policy_object_standard_community_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index 777fe4e1c..63cbe487e 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -47,21 +47,21 @@ description: |- - Add `sdwan_service_switchport_profile_parcel` resource and data source - Add `sdwan_transport_route_policy_profile_parcel` resource and data source - Add `sdwan_service_route_policy_profile_parcel` resource and data source -- Add `sdwan_policy_object_app_probe_profile_parcel` resource and data source -- Add `sdwan_policy_object_as_path_profile_parcel` resource and data source +- Add `sdwan_policy_object_app_probe_class_profile_parcel` resource and data source +- Add `sdwan_policy_object_as_path_list_profile_parcel` resource and data source - Add `sdwan_policy_object_vpn_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_data_ip_prefix_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_fqdn_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_geolocation_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_fqdn_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_geolocation_list_profile_parcel` resource and data source - Add `sdwan_policy_object_security_ips_signature_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localdomain_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_port_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_scalable_group_tag_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_urllist_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_domain_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_port_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_scalable_group_tag_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_url_list_profile_parcel` resource and data source - Add `sdwan_policy_object_preferred_color_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_identity_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localapp_profile_parcel` resource and data source -- Add `sdwan_policy_object_standard_community_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_identity_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_application_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_standard_community_list_profile_parcel` resource and data source ## 0.3.13 diff --git a/docs/resources/policy_object_app_probe_profile_parcel.md b/docs/resources/policy_object_app_probe_class_profile_parcel.md similarity index 77% rename from docs/resources/policy_object_app_probe_profile_parcel.md rename to docs/resources/policy_object_app_probe_class_profile_parcel.md index 2b2ca23c5..4a7cc1e5c 100644 --- a/docs/resources/policy_object_app_probe_profile_parcel.md +++ b/docs/resources/policy_object_app_probe_class_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_app_probe_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_app_probe_class_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object App Probe profile parcel. + This resource can manage a Policy Object App Probe Class profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_app_probe_profile_parcel (Resource) +# sdwan_policy_object_app_probe_class_profile_parcel (Resource) -This resource can manage a Policy Object App Probe profile parcel. +This resource can manage a Policy Object App Probe Class profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_app_probe_profile_parcel" "example" { +resource "sdwan_policy_object_app_probe_class_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -74,5 +74,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_app_probe_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_app_probe_class_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_as_path_profile_parcel.md b/docs/resources/policy_object_as_path_list_profile_parcel.md similarity index 70% rename from docs/resources/policy_object_as_path_profile_parcel.md rename to docs/resources/policy_object_as_path_list_profile_parcel.md index d637a7d92..b27cd1725 100644 --- a/docs/resources/policy_object_as_path_profile_parcel.md +++ b/docs/resources/policy_object_as_path_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_as_path_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_as_path_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object AS Path profile parcel. + This resource can manage a Policy Object AS Path List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_as_path_profile_parcel (Resource) +# sdwan_policy_object_as_path_list_profile_parcel (Resource) -This resource can manage a Policy Object AS Path profile parcel. +This resource can manage a Policy Object AS Path List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_as_path_profile_parcel" "example" { +resource "sdwan_policy_object_as_path_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -60,5 +60,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_as_path_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_as_path_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_data_ip_prefix_profile_parcel.md b/docs/resources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md similarity index 65% rename from docs/resources/policy_object_security_data_ip_prefix_profile_parcel.md rename to docs/resources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md index 537222728..26ab98f02 100644 --- a/docs/resources/policy_object_security_data_ip_prefix_profile_parcel.md +++ b/docs/resources/policy_object_security_data_ipv4_prefix_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_data_ip_prefix_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Data IP Prefix profile parcel. + This resource can manage a Policy Object Security Data IPv4 Prefix List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_data_ip_prefix_profile_parcel (Resource) +# sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Data IP Prefix profile parcel. +This resource can manage a Policy Object Security Data IPv4 Prefix List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "example" { +resource "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -58,5 +58,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_data_ip_prefix_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_fqdn_profile_parcel.md b/docs/resources/policy_object_security_fqdn_list_profile_parcel.md similarity index 66% rename from docs/resources/policy_object_security_fqdn_profile_parcel.md rename to docs/resources/policy_object_security_fqdn_list_profile_parcel.md index 34e5688ec..779fac003 100644 --- a/docs/resources/policy_object_security_fqdn_profile_parcel.md +++ b/docs/resources/policy_object_security_fqdn_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_fqdn_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_fqdn_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security FQDN profile parcel. + This resource can manage a Policy Object Security FQDN List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_fqdn_profile_parcel (Resource) +# sdwan_policy_object_security_fqdn_list_profile_parcel (Resource) -This resource can manage a Policy Object Security FQDN profile parcel. +This resource can manage a Policy Object Security FQDN List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_fqdn_profile_parcel" "example" { +resource "sdwan_policy_object_security_fqdn_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -57,5 +57,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_fqdn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_fqdn_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_geolocation_profile_parcel.md b/docs/resources/policy_object_security_geolocation_list_profile_parcel.md similarity index 85% rename from docs/resources/policy_object_security_geolocation_profile_parcel.md rename to docs/resources/policy_object_security_geolocation_list_profile_parcel.md index 218ae1040..a3a3ab213 100644 --- a/docs/resources/policy_object_security_geolocation_profile_parcel.md +++ b/docs/resources/policy_object_security_geolocation_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_geolocation_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_geolocation_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Geolocation profile parcel. + This resource can manage a Policy Object Security Geolocation List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_geolocation_profile_parcel (Resource) +# sdwan_policy_object_security_geolocation_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Geolocation profile parcel. +This resource can manage a Policy Object Security Geolocation List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_geolocation_profile_parcel" "example" { +resource "sdwan_policy_object_security_geolocation_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -60,5 +60,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_geolocation_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_geolocation_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_identity_profile_parcel.md b/docs/resources/policy_object_security_identity_list_profile_parcel.md similarity index 67% rename from docs/resources/policy_object_security_identity_profile_parcel.md rename to docs/resources/policy_object_security_identity_list_profile_parcel.md index 649c37800..fd0c1653a 100644 --- a/docs/resources/policy_object_security_identity_profile_parcel.md +++ b/docs/resources/policy_object_security_identity_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_identity_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_identity_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Identity profile parcel. + This resource can manage a Policy Object Security Identity List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_identity_profile_parcel (Resource) +# sdwan_policy_object_security_identity_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Identity profile parcel. +This resource can manage a Policy Object Security Identity List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_identity_profile_parcel" "example" { +resource "sdwan_policy_object_security_identity_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -58,5 +58,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_identity_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_identity_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_ips_signature_profile_parcel.md b/docs/resources/policy_object_security_ips_signature_profile_parcel.md index 5628f8aa1..4b97a1972 100644 --- a/docs/resources/policy_object_security_ips_signature_profile_parcel.md +++ b/docs/resources/policy_object_security_ips_signature_profile_parcel.md @@ -3,13 +3,13 @@ page_title: "sdwan_policy_object_security_ips_signature_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security IPs Signature profile parcel. + This resource can manage a Policy Object Security IPS Signature profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- # sdwan_policy_object_security_ips_signature_profile_parcel (Resource) -This resource can manage a Policy Object Security IPs Signature profile parcel. +This resource can manage a Policy Object Security IPS Signature profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage diff --git a/docs/resources/policy_object_security_localapp_profile_parcel.md b/docs/resources/policy_object_security_local_application_list_profile_parcel.md similarity index 64% rename from docs/resources/policy_object_security_localapp_profile_parcel.md rename to docs/resources/policy_object_security_local_application_list_profile_parcel.md index f149ba060..4d6054d45 100644 --- a/docs/resources/policy_object_security_localapp_profile_parcel.md +++ b/docs/resources/policy_object_security_local_application_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_localapp_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_local_application_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Localapp profile parcel. + This resource can manage a Policy Object Security Local Application List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_localapp_profile_parcel (Resource) +# sdwan_policy_object_security_local_application_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Localapp profile parcel. +This resource can manage a Policy Object Security Local Application List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_localapp_profile_parcel" "example" { +resource "sdwan_policy_object_security_local_application_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -58,5 +58,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_localapp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_local_application_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_localdomain_profile_parcel.md b/docs/resources/policy_object_security_local_domain_list_profile_parcel.md similarity index 61% rename from docs/resources/policy_object_security_localdomain_profile_parcel.md rename to docs/resources/policy_object_security_local_domain_list_profile_parcel.md index c1129862b..bf7aab0ac 100644 --- a/docs/resources/policy_object_security_localdomain_profile_parcel.md +++ b/docs/resources/policy_object_security_local_domain_list_profile_parcel.md @@ -1,27 +1,27 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_localdomain_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_local_domain_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Localdomain profile parcel. + This resource can manage a Policy Object Security Local Domain List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_localdomain_profile_parcel (Resource) +# sdwan_policy_object_security_local_domain_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Localdomain profile parcel. +This resource can manage a Policy Object Security Local Domain List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_localdomain_profile_parcel" "example" { +resource "sdwan_policy_object_security_local_domain_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" entries = [ { - name_server = "hello.com" + local_domain = "hello.com" } ] } @@ -50,12 +50,12 @@ resource "sdwan_policy_object_security_localdomain_profile_parcel" "example" { Optional: -- `name_server` (String) +- `local_domain` (String) ## Import Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_localdomain_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_local_domain_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_port_profile_parcel.md b/docs/resources/policy_object_security_port_list_profile_parcel.md similarity index 67% rename from docs/resources/policy_object_security_port_profile_parcel.md rename to docs/resources/policy_object_security_port_list_profile_parcel.md index c1bee5a92..72e4d3774 100644 --- a/docs/resources/policy_object_security_port_profile_parcel.md +++ b/docs/resources/policy_object_security_port_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_port_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_port_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Port profile parcel. + This resource can manage a Policy Object Security Port List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_port_profile_parcel (Resource) +# sdwan_policy_object_security_port_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Port profile parcel. +This resource can manage a Policy Object Security Port List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_port_profile_parcel" "example" { +resource "sdwan_policy_object_security_port_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -57,5 +57,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_port_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_port_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_scalable_group_tag_profile_parcel.md b/docs/resources/policy_object_security_scalable_group_tag_list_profile_parcel.md similarity index 75% rename from docs/resources/policy_object_security_scalable_group_tag_profile_parcel.md rename to docs/resources/policy_object_security_scalable_group_tag_list_profile_parcel.md index 0fa0c01ea..1ba34c73c 100644 --- a/docs/resources/policy_object_security_scalable_group_tag_profile_parcel.md +++ b/docs/resources/policy_object_security_scalable_group_tag_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_scalable_group_tag_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security Scalable Group Tag profile parcel. + This resource can manage a Policy Object Security Scalable Group Tag List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_scalable_group_tag_profile_parcel (Resource) +# sdwan_policy_object_security_scalable_group_tag_list_profile_parcel (Resource) -This resource can manage a Policy Object Security Scalable Group Tag profile parcel. +This resource can manage a Policy Object Security Scalable Group Tag List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "example" { +resource "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "" @@ -59,5 +59,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_scalable_group_tag_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_security_urllist_profile_parcel.md b/docs/resources/policy_object_security_url_list_profile_parcel.md similarity index 67% rename from docs/resources/policy_object_security_urllist_profile_parcel.md rename to docs/resources/policy_object_security_url_list_profile_parcel.md index 100407a91..5cb0390d2 100644 --- a/docs/resources/policy_object_security_urllist_profile_parcel.md +++ b/docs/resources/policy_object_security_url_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_security_urllist_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_security_url_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Security URLlist profile parcel. + This resource can manage a Policy Object Security URL List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_security_urllist_profile_parcel (Resource) +# sdwan_policy_object_security_url_list_profile_parcel (Resource) -This resource can manage a Policy Object Security URLlist profile parcel. +This resource can manage a Policy Object Security URL List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_security_urllist_profile_parcel" "example" { +resource "sdwan_policy_object_security_url_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -57,5 +57,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_security_urllist_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_security_url_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/docs/resources/policy_object_standard_community_profile_parcel.md b/docs/resources/policy_object_standard_community_list_profile_parcel.md similarity index 67% rename from docs/resources/policy_object_standard_community_profile_parcel.md rename to docs/resources/policy_object_standard_community_list_profile_parcel.md index eda00a348..4ca32f61b 100644 --- a/docs/resources/policy_object_standard_community_profile_parcel.md +++ b/docs/resources/policy_object_standard_community_list_profile_parcel.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "sdwan_policy_object_standard_community_profile_parcel Resource - terraform-provider-sdwan" +page_title: "sdwan_policy_object_standard_community_list_profile_parcel Resource - terraform-provider-sdwan" subcategory: "Profile Parcels" description: |- - This resource can manage a Policy Object Standard Community profile parcel. + This resource can manage a Policy Object Standard Community List profile parcel. Minimum SD-WAN Manager version: 20.12.0 --- -# sdwan_policy_object_standard_community_profile_parcel (Resource) +# sdwan_policy_object_standard_community_list_profile_parcel (Resource) -This resource can manage a Policy Object Standard Community profile parcel. +This resource can manage a Policy Object Standard Community List profile parcel. - Minimum SD-WAN Manager version: `20.12.0` ## Example Usage ```terraform -resource "sdwan_policy_object_standard_community_profile_parcel" "example" { +resource "sdwan_policy_object_standard_community_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" @@ -57,5 +57,5 @@ Optional: Import is supported using the following syntax: ```shell -terraform import sdwan_policy_object_standard_community_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +terraform import sdwan_policy_object_standard_community_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" ``` diff --git a/examples/data-sources/sdwan_policy_object_as_path_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_app_probe_class_profile_parcel/data-source.tf similarity index 64% rename from examples/data-sources/sdwan_policy_object_as_path_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_app_probe_class_profile_parcel/data-source.tf index 7cab9092e..d6998b5a0 100644 --- a/examples/data-sources/sdwan_policy_object_as_path_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_app_probe_class_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_as_path_profile_parcel" "example" { +data "sdwan_policy_object_app_probe_class_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_app_probe_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_as_path_list_profile_parcel/data-source.tf similarity index 65% rename from examples/data-sources/sdwan_policy_object_app_probe_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_as_path_list_profile_parcel/data-source.tf index 07e958636..618846ccf 100644 --- a/examples/data-sources/sdwan_policy_object_app_probe_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_as_path_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_app_probe_profile_parcel" "example" { +data "sdwan_policy_object_as_path_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/data-source.tf new file mode 100644 index 000000000..766cb9a42 --- /dev/null +++ b/examples/data-sources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/data-source.tf @@ -0,0 +1,4 @@ +data "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "example" { + id = "f6b2c44c-693c-4763-b010-895aa3d236bd" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" +} diff --git a/examples/data-sources/sdwan_policy_object_standard_community_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_fqdn_list_profile_parcel/data-source.tf similarity index 67% rename from examples/data-sources/sdwan_policy_object_standard_community_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_fqdn_list_profile_parcel/data-source.tf index 8a4c4f3f1..bfff65e73 100644 --- a/examples/data-sources/sdwan_policy_object_standard_community_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_fqdn_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_standard_community_profile_parcel" "example" { +data "sdwan_policy_object_security_fqdn_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_fqdn_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_geolocation_list_profile_parcel/data-source.tf similarity index 61% rename from examples/data-sources/sdwan_policy_object_security_fqdn_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_geolocation_list_profile_parcel/data-source.tf index d9c9f2a65..26acf175c 100644 --- a/examples/data-sources/sdwan_policy_object_security_fqdn_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_geolocation_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_fqdn_profile_parcel" "example" { +data "sdwan_policy_object_security_geolocation_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_geolocation_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_identity_list_profile_parcel/data-source.tf similarity index 62% rename from examples/data-sources/sdwan_policy_object_security_geolocation_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_identity_list_profile_parcel/data-source.tf index cad348b59..7999fa6ad 100644 --- a/examples/data-sources/sdwan_policy_object_security_geolocation_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_identity_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_geolocation_profile_parcel" "example" { +data "sdwan_policy_object_security_identity_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_local_application_list_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_local_application_list_profile_parcel/data-source.tf new file mode 100644 index 000000000..fd7608b1f --- /dev/null +++ b/examples/data-sources/sdwan_policy_object_security_local_application_list_profile_parcel/data-source.tf @@ -0,0 +1,4 @@ +data "sdwan_policy_object_security_local_application_list_profile_parcel" "example" { + id = "f6b2c44c-693c-4763-b010-895aa3d236bd" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" +} diff --git a/examples/data-sources/sdwan_policy_object_security_local_domain_list_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_local_domain_list_profile_parcel/data-source.tf new file mode 100644 index 000000000..aad08f01f --- /dev/null +++ b/examples/data-sources/sdwan_policy_object_security_local_domain_list_profile_parcel/data-source.tf @@ -0,0 +1,4 @@ +data "sdwan_policy_object_security_local_domain_list_profile_parcel" "example" { + id = "f6b2c44c-693c-4763-b010-895aa3d236bd" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" +} diff --git a/examples/data-sources/sdwan_policy_object_security_localdomain_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_localdomain_profile_parcel/data-source.tf deleted file mode 100644 index f04543bd0..000000000 --- a/examples/data-sources/sdwan_policy_object_security_localdomain_profile_parcel/data-source.tf +++ /dev/null @@ -1,4 +0,0 @@ -data "sdwan_policy_object_security_localdomain_profile_parcel" "example" { - id = "f6b2c44c-693c-4763-b010-895aa3d236bd" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" -} diff --git a/examples/data-sources/sdwan_policy_object_security_identity_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_port_list_profile_parcel/data-source.tf similarity index 63% rename from examples/data-sources/sdwan_policy_object_security_identity_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_port_list_profile_parcel/data-source.tf index 9557b2ab5..7c57605cd 100644 --- a/examples/data-sources/sdwan_policy_object_security_identity_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_port_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_identity_profile_parcel" "example" { +data "sdwan_policy_object_security_port_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_port_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_port_profile_parcel/data-source.tf deleted file mode 100644 index 3216e905a..000000000 --- a/examples/data-sources/sdwan_policy_object_security_port_profile_parcel/data-source.tf +++ /dev/null @@ -1,4 +0,0 @@ -data "sdwan_policy_object_security_port_profile_parcel" "example" { - id = "f6b2c44c-693c-4763-b010-895aa3d236bd" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" -} diff --git a/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/data-source.tf similarity index 50% rename from examples/data-sources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/data-source.tf index 2c9c7273e..76510acdc 100644 --- a/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "example" { +data "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "" } diff --git a/examples/data-sources/sdwan_policy_object_security_localapp_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_url_list_profile_parcel/data-source.tf similarity index 67% rename from examples/data-sources/sdwan_policy_object_security_localapp_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_security_url_list_profile_parcel/data-source.tf index 4acb189e9..a3ad7a009 100644 --- a/examples/data-sources/sdwan_policy_object_security_localapp_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_security_url_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_localapp_profile_parcel" "example" { +data "sdwan_policy_object_security_url_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/data-sources/sdwan_policy_object_security_urllist_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_security_urllist_profile_parcel/data-source.tf deleted file mode 100644 index bf3210f20..000000000 --- a/examples/data-sources/sdwan_policy_object_security_urllist_profile_parcel/data-source.tf +++ /dev/null @@ -1,4 +0,0 @@ -data "sdwan_policy_object_security_urllist_profile_parcel" "example" { - id = "f6b2c44c-693c-4763-b010-895aa3d236bd" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" -} diff --git a/examples/data-sources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/data-source.tf b/examples/data-sources/sdwan_policy_object_standard_community_list_profile_parcel/data-source.tf similarity index 68% rename from examples/data-sources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_policy_object_standard_community_list_profile_parcel/data-source.tf index d8a9fc8d9..4ecae8750 100644 --- a/examples/data-sources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/data-source.tf +++ b/examples/data-sources/sdwan_policy_object_standard_community_list_profile_parcel/data-source.tf @@ -1,4 +1,4 @@ -data "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "example" { +data "sdwan_policy_object_standard_community_list_profile_parcel" "example" { id = "f6b2c44c-693c-4763-b010-895aa3d236bd" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" } diff --git a/examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/import.sh new file mode 100644 index 000000000..8834cf76f --- /dev/null +++ b/examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_app_probe_class_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_app_probe_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/resource.tf similarity index 79% rename from examples/resources/sdwan_policy_object_app_probe_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/resource.tf index 217612fb8..c432767f5 100644 --- a/examples/resources/sdwan_policy_object_app_probe_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_app_probe_class_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_app_probe_profile_parcel" "example" { +resource "sdwan_policy_object_app_probe_class_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_app_probe_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_app_probe_profile_parcel/import.sh deleted file mode 100644 index ed6de6654..000000000 --- a/examples/resources/sdwan_policy_object_app_probe_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_app_probe_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_as_path_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_as_path_list_profile_parcel/import.sh new file mode 100644 index 000000000..cb864b469 --- /dev/null +++ b/examples/resources/sdwan_policy_object_as_path_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_as_path_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_as_path_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_as_path_list_profile_parcel/resource.tf similarity index 75% rename from examples/resources/sdwan_policy_object_as_path_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_as_path_list_profile_parcel/resource.tf index aa9f85fd6..ae7801244 100644 --- a/examples/resources/sdwan_policy_object_as_path_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_as_path_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_as_path_profile_parcel" "example" { +resource "sdwan_policy_object_as_path_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_as_path_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_as_path_profile_parcel/import.sh deleted file mode 100644 index de9802cdc..000000000 --- a/examples/resources/sdwan_policy_object_as_path_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_as_path_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/import.sh deleted file mode 100644 index 0a1c9cd88..000000000 --- a/examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_data_ip_prefix_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/import.sh new file mode 100644 index 000000000..a5fba8950 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/resource.tf similarity index 68% rename from examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/resource.tf index 459a106b7..2157b3ac2 100644 --- a/examples/resources/sdwan_policy_object_security_data_ip_prefix_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "example" { +resource "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/import.sh new file mode 100644 index 000000000..0d9c3505c --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_fqdn_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/resource.tf similarity index 71% rename from examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/resource.tf index 4fe67fca3..8eee54675 100644 --- a/examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_fqdn_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_fqdn_profile_parcel" "example" { +resource "sdwan_policy_object_security_fqdn_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/import.sh deleted file mode 100644 index 38b3aa9f3..000000000 --- a/examples/resources/sdwan_policy_object_security_fqdn_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_fqdn_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/import.sh new file mode 100644 index 000000000..6100fbd49 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_geolocation_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/resource.tf similarity index 68% rename from examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/resource.tf index 9b7a4ac72..6d75fef32 100644 --- a/examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_geolocation_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_geolocation_profile_parcel" "example" { +resource "sdwan_policy_object_security_geolocation_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/import.sh deleted file mode 100644 index dd3413770..000000000 --- a/examples/resources/sdwan_policy_object_security_geolocation_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_geolocation_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/import.sh new file mode 100644 index 000000000..b1c3798e1 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_identity_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_identity_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/resource.tf similarity index 70% rename from examples/resources/sdwan_policy_object_security_identity_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/resource.tf index da0ac6d37..8632da50b 100644 --- a/examples/resources/sdwan_policy_object_security_identity_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_identity_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_identity_profile_parcel" "example" { +resource "sdwan_policy_object_security_identity_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_identity_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_identity_profile_parcel/import.sh deleted file mode 100644 index 8f1269c73..000000000 --- a/examples/resources/sdwan_policy_object_security_identity_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_identity_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/import.sh new file mode 100644 index 000000000..531588adf --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_local_application_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_localapp_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/resource.tf similarity index 67% rename from examples/resources/sdwan_policy_object_security_localapp_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/resource.tf index 60869976b..6d15d96a0 100644 --- a/examples/resources/sdwan_policy_object_security_localapp_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_local_application_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_localapp_profile_parcel" "example" { +resource "sdwan_policy_object_security_local_application_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/import.sh new file mode 100644 index 000000000..886a4e8e9 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_local_domain_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/resource.tf new file mode 100644 index 000000000..88ce03476 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_local_domain_list_profile_parcel/resource.tf @@ -0,0 +1,10 @@ +resource "sdwan_policy_object_security_local_domain_list_profile_parcel" "example" { + name = "Example" + description = "My Example" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" + entries = [ + { + local_domain = "hello.com" + } + ] +} diff --git a/examples/resources/sdwan_policy_object_security_localapp_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_localapp_profile_parcel/import.sh deleted file mode 100644 index 4db2250db..000000000 --- a/examples/resources/sdwan_policy_object_security_localapp_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_localapp_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/import.sh deleted file mode 100644 index 484f55f43..000000000 --- a/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_localdomain_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/resource.tf deleted file mode 100644 index df213838f..000000000 --- a/examples/resources/sdwan_policy_object_security_localdomain_profile_parcel/resource.tf +++ /dev/null @@ -1,10 +0,0 @@ -resource "sdwan_policy_object_security_localdomain_profile_parcel" "example" { - name = "Example" - description = "My Example" - feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" - entries = [ - { - name_server = "hello.com" - } - ] -} diff --git a/examples/resources/sdwan_policy_object_security_port_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_port_list_profile_parcel/import.sh new file mode 100644 index 000000000..a0f8442db --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_port_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_port_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_port_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_port_list_profile_parcel/resource.tf similarity index 70% rename from examples/resources/sdwan_policy_object_security_port_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_port_list_profile_parcel/resource.tf index 7a014511e..88a09a0be 100644 --- a/examples/resources/sdwan_policy_object_security_port_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_port_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_port_profile_parcel" "example" { +resource "sdwan_policy_object_security_port_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_port_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_port_profile_parcel/import.sh deleted file mode 100644 index 57f4b818a..000000000 --- a/examples/resources/sdwan_policy_object_security_port_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_port_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/import.sh new file mode 100644 index 000000000..8b4c7b444 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/resource.tf similarity index 65% rename from examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/resource.tf index 0216c4074..e3693c601 100644 --- a/examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_scalable_group_tag_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "example" { +resource "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "" diff --git a/examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/import.sh deleted file mode 100644 index c60b3f4dc..000000000 --- a/examples/resources/sdwan_policy_object_security_scalable_group_tag_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_scalable_group_tag_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_url_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_url_list_profile_parcel/import.sh new file mode 100644 index 000000000..c6ad853c0 --- /dev/null +++ b/examples/resources/sdwan_policy_object_security_url_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_security_url_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_security_urllist_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_security_url_list_profile_parcel/resource.tf similarity index 71% rename from examples/resources/sdwan_policy_object_security_urllist_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_security_url_list_profile_parcel/resource.tf index 4b843895b..36d0b2a83 100644 --- a/examples/resources/sdwan_policy_object_security_urllist_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_security_url_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_security_urllist_profile_parcel" "example" { +resource "sdwan_policy_object_security_url_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_security_urllist_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_security_urllist_profile_parcel/import.sh deleted file mode 100644 index 4b9e36eed..000000000 --- a/examples/resources/sdwan_policy_object_security_urllist_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_security_urllist_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/import.sh new file mode 100644 index 000000000..c3af5ac9a --- /dev/null +++ b/examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/import.sh @@ -0,0 +1 @@ +terraform import sdwan_policy_object_standard_community_list_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/examples/resources/sdwan_policy_object_standard_community_profile_parcel/resource.tf b/examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/resource.tf similarity index 71% rename from examples/resources/sdwan_policy_object_standard_community_profile_parcel/resource.tf rename to examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/resource.tf index 798bf3a7b..d913f3557 100644 --- a/examples/resources/sdwan_policy_object_standard_community_profile_parcel/resource.tf +++ b/examples/resources/sdwan_policy_object_standard_community_list_profile_parcel/resource.tf @@ -1,4 +1,4 @@ -resource "sdwan_policy_object_standard_community_profile_parcel" "example" { +resource "sdwan_policy_object_standard_community_list_profile_parcel" "example" { name = "Example" description = "My Example" feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" diff --git a/examples/resources/sdwan_policy_object_standard_community_profile_parcel/import.sh b/examples/resources/sdwan_policy_object_standard_community_profile_parcel/import.sh deleted file mode 100644 index 9336e3da9..000000000 --- a/examples/resources/sdwan_policy_object_standard_community_profile_parcel/import.sh +++ /dev/null @@ -1 +0,0 @@ -terraform import sdwan_policy_object_standard_community_profile_parcel.example "f6b2c44c-693c-4763-b010-895aa3d236bd" diff --git a/gen/definitions/profile_parcels/policy_object_app_probe.yaml b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml similarity index 95% rename from gen/definitions/profile_parcels/policy_object_app_probe.yaml rename to gen/definitions/profile_parcels/policy_object_app_probe_class.yaml index a91e0d7dc..8f199028d 100644 --- a/gen/definitions/profile_parcels/policy_object_app_probe.yaml +++ b/gen/definitions/profile_parcels/policy_object_app_probe_class.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object App Probe +name: Policy Object App Probe Class rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/app-probe minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_as_path.yaml b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml similarity index 95% rename from gen/definitions/profile_parcels/policy_object_as_path.yaml rename to gen/definitions/profile_parcels/policy_object_as_path_list.yaml index 22e17bd67..76b1cbacf 100644 --- a/gen/definitions/profile_parcels/policy_object_as_path.yaml +++ b/gen/definitions/profile_parcels/policy_object_as_path_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object AS Path +name: Policy Object AS Path List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/as-path minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_data_ip_prefix.yaml b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml similarity index 92% rename from gen/definitions/profile_parcels/policy_object_security_data_ip_prefix.yaml rename to gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml index d9c7c50ed..dbbe2ac72 100644 --- a/gen/definitions/profile_parcels/policy_object_security_data_ip_prefix.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_data_ipv4_prefix_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Data IP Prefix +name: Policy Object Security Data IPv4 Prefix List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-data-ip-prefix minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_fqdn.yaml b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml similarity index 94% rename from gen/definitions/profile_parcels/policy_object_security_fqdn.yaml rename to gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml index 7707141fc..e96cbac54 100644 --- a/gen/definitions/profile_parcels/policy_object_security_fqdn.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_fqdn_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security FQDN +name: Policy Object Security FQDN List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-fqdn minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_geolocation.yaml b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml similarity index 93% rename from gen/definitions/profile_parcels/policy_object_security_geolocation.yaml rename to gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml index 13bd8b279..dcc7e6f59 100644 --- a/gen/definitions/profile_parcels/policy_object_security_geolocation.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_geolocation_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Geolocation +name: Policy Object Security Geolocation List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-geolocation minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_identity.yaml b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml similarity index 94% rename from gen/definitions/profile_parcels/policy_object_security_identity.yaml rename to gen/definitions/profile_parcels/policy_object_security_identity_list.yaml index f7c87e0d5..4eb414eb1 100644 --- a/gen/definitions/profile_parcels/policy_object_security_identity.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_identity_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Identity +name: Policy Object Security Identity List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-identity minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] 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 2794a097e..0b0fc403e 100644 --- a/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_ips_signature.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security IPs Signature +name: Policy Object Security IPS Signature rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-ipssignature minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_localapp.yaml b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml similarity index 92% rename from gen/definitions/profile_parcels/policy_object_security_localapp.yaml rename to gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml index de4f2d3e7..3b9caccd5 100644 --- a/gen/definitions/profile_parcels/policy_object_security_localapp.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_local_application_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Localapp +name: Policy Object Security Local Application List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-localapp minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_localdomain.yaml b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml similarity index 89% rename from gen/definitions/profile_parcels/policy_object_security_localdomain.yaml rename to gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml index f24e716ab..5cf991b1a 100644 --- a/gen/definitions/profile_parcels/policy_object_security_localdomain.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_local_domain_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Localdomain +name: Policy Object Security Local Domain List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-localdomain minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] @@ -16,6 +16,7 @@ attributes: mandatory: true 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.yaml b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml similarity index 94% rename from gen/definitions/profile_parcels/policy_object_security_port.yaml rename to gen/definitions/profile_parcels/policy_object_security_port_list.yaml index 711850495..d42440f58 100644 --- a/gen/definitions/profile_parcels/policy_object_security_port.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_port_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Port +name: Policy Object Security Port List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-port minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag.yaml b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml similarity index 92% rename from gen/definitions/profile_parcels/policy_object_security_scalable_group_tag.yaml rename to gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml index ceb2e1694..c77268961 100644 --- a/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_scalable_group_tag_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security Scalable Group Tag +name: Policy Object Security Scalable Group Tag List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-scalablegrouptag minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_security_urllist.yaml b/gen/definitions/profile_parcels/policy_object_security_url_list.yaml similarity index 94% rename from gen/definitions/profile_parcels/policy_object_security_urllist.yaml rename to gen/definitions/profile_parcels/policy_object_security_url_list.yaml index 8dcc16ed0..4102432ca 100644 --- a/gen/definitions/profile_parcels/policy_object_security_urllist.yaml +++ b/gen/definitions/profile_parcels/policy_object_security_url_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Security URLlist +name: Policy Object Security URL List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-urllist minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/definitions/profile_parcels/policy_object_standard_community.yaml b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml similarity index 93% rename from gen/definitions/profile_parcels/policy_object_standard_community.yaml rename to gen/definitions/profile_parcels/policy_object_standard_community_list.yaml index 4c5298872..8a84e84e0 100644 --- a/gen/definitions/profile_parcels/policy_object_standard_community.yaml +++ b/gen/definitions/profile_parcels/policy_object_standard_community_list.yaml @@ -1,5 +1,5 @@ --- -name: Policy Object Standard Community +name: Policy Object Standard Community List rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/standard-community minimum_version: 20.12.0 test_tags: [SDWAN_2012, TF_VAR_policy_object_feature_template_id] diff --git a/gen/models/profile_parcels/policy_object_app_probe.json b/gen/models/profile_parcels/policy_object_app_probe_class.json similarity index 100% rename from gen/models/profile_parcels/policy_object_app_probe.json rename to gen/models/profile_parcels/policy_object_app_probe_class.json diff --git a/gen/models/profile_parcels/policy_object_as_path.json b/gen/models/profile_parcels/policy_object_as_path_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_as_path.json rename to gen/models/profile_parcels/policy_object_as_path_list.json diff --git a/gen/models/profile_parcels/policy_object_security_data_ip_prefix.json b/gen/models/profile_parcels/policy_object_security_data_ipv4_prefix_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_data_ip_prefix.json rename to gen/models/profile_parcels/policy_object_security_data_ipv4_prefix_list.json diff --git a/gen/models/profile_parcels/policy_object_security_fqdn.json b/gen/models/profile_parcels/policy_object_security_fqdn_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_fqdn.json rename to gen/models/profile_parcels/policy_object_security_fqdn_list.json diff --git a/gen/models/profile_parcels/policy_object_security_geolocation.json b/gen/models/profile_parcels/policy_object_security_geolocation_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_geolocation.json rename to gen/models/profile_parcels/policy_object_security_geolocation_list.json diff --git a/gen/models/profile_parcels/policy_object_security_identity.json b/gen/models/profile_parcels/policy_object_security_identity_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_identity.json rename to gen/models/profile_parcels/policy_object_security_identity_list.json diff --git a/gen/models/profile_parcels/policy_object_security_localapp.json b/gen/models/profile_parcels/policy_object_security_local_application_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_localapp.json rename to gen/models/profile_parcels/policy_object_security_local_application_list.json diff --git a/gen/models/profile_parcels/policy_object_security_localdomain.json b/gen/models/profile_parcels/policy_object_security_local_domain_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_localdomain.json rename to gen/models/profile_parcels/policy_object_security_local_domain_list.json diff --git a/gen/models/profile_parcels/policy_object_security_port.json b/gen/models/profile_parcels/policy_object_security_port_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_port.json rename to gen/models/profile_parcels/policy_object_security_port_list.json diff --git a/gen/models/profile_parcels/policy_object_security_scalable_group_tag.json b/gen/models/profile_parcels/policy_object_security_scalable_group_tag_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_scalable_group_tag.json rename to gen/models/profile_parcels/policy_object_security_scalable_group_tag_list.json diff --git a/gen/models/profile_parcels/policy_object_security_urllist.json b/gen/models/profile_parcels/policy_object_security_url_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_security_urllist.json rename to gen/models/profile_parcels/policy_object_security_url_list.json diff --git a/gen/models/profile_parcels/policy_object_standard_community.json b/gen/models/profile_parcels/policy_object_standard_community_list.json similarity index 100% rename from gen/models/profile_parcels/policy_object_standard_community.json rename to gen/models/profile_parcels/policy_object_standard_community_list.json diff --git a/internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel.go similarity index 78% rename from internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel.go index f4931f4c8..a5e0e1194 100644 --- a/internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectAppProbeProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectAppProbeProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectAppProbeClassProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectAppProbeClassProfileParcelDataSource{} ) -func NewPolicyObjectAppProbeProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectAppProbeProfileParcelDataSource{} +func NewPolicyObjectAppProbeClassProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectAppProbeClassProfileParcelDataSource{} } -type PolicyObjectAppProbeProfileParcelDataSource struct { +type PolicyObjectAppProbeClassProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectAppProbeProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_profile_parcel" +func (d *PolicyObjectAppProbeClassProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_class_profile_parcel" } -func (d *PolicyObjectAppProbeProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectAppProbeClassProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object App Probe profile parcel.", + MarkdownDescription: "This data source can read the Policy Object App Probe Class profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -109,7 +109,7 @@ func (d *PolicyObjectAppProbeProfileParcelDataSource) Schema(ctx context.Context } } -func (d *PolicyObjectAppProbeProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectAppProbeClassProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -120,8 +120,8 @@ func (d *PolicyObjectAppProbeProfileParcelDataSource) Configure(_ context.Contex // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectAppProbeProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectAppProbe +func (d *PolicyObjectAppProbeClassProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectAppProbeClass // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel_test.go similarity index 74% rename from internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel_test.go index fc321339c..86fb775b2 100644 --- a/internal/provider/data_source_sdwan_policy_object_app_probe_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_app_probe_class_profile_parcel_test.go @@ -28,20 +28,20 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectAppProbeProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.map.0.color", "3g")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.map.0.dscp", "45")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.forwarding_class", "classlist1")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.map.0.color", "3g")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.map.0.dscp", "45")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.forwarding_class", "classlist1")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectAppProbePrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectAppProbeProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -51,15 +51,15 @@ func TestAccDataSourceSdwanPolicyObjectAppProbeProfileParcel(t *testing.T) { // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectAppProbePrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectAppProbeProfileParcelConfig() string { - config := `resource "sdwan_policy_object_app_probe_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectAppProbeClassProfileParcelConfig() string { + config := `resource "sdwan_policy_object_app_probe_class_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -73,8 +73,8 @@ func testAccDataSourceSdwanPolicyObjectAppProbeProfileParcelConfig() string { config += `}` + "\n" config += ` - data "sdwan_policy_object_app_probe_profile_parcel" "test" { - id = sdwan_policy_object_app_probe_profile_parcel.test.id + data "sdwan_policy_object_app_probe_class_profile_parcel" "test" { + id = sdwan_policy_object_app_probe_class_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel.go similarity index 77% rename from internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel.go index 858e734b8..301d84bf0 100644 --- a/internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectASPathProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectASPathProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectASPathListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectASPathListProfileParcelDataSource{} ) -func NewPolicyObjectASPathProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectASPathProfileParcelDataSource{} +func NewPolicyObjectASPathListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectASPathListProfileParcelDataSource{} } -type PolicyObjectASPathProfileParcelDataSource struct { +type PolicyObjectASPathListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectASPathProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_profile_parcel" +func (d *PolicyObjectASPathListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_list_profile_parcel" } -func (d *PolicyObjectASPathProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectASPathListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object AS Path profile parcel.", + MarkdownDescription: "This data source can read the Policy Object AS Path List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -97,7 +97,7 @@ func (d *PolicyObjectASPathProfileParcelDataSource) Schema(ctx context.Context, } } -func (d *PolicyObjectASPathProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectASPathListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +108,8 @@ func (d *PolicyObjectASPathProfileParcelDataSource) Configure(_ context.Context, // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectASPathProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectASPath +func (d *PolicyObjectASPathListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectASPathList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel_test.go similarity index 76% rename from internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel_test.go index fdb525e5e..0a7da1b02 100644 --- a/internal/provider/data_source_sdwan_policy_object_as_path_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_as_path_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectASPathProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectASPathListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_profile_parcel.test", "as_path_list_id", "1")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_profile_parcel.test", "entries.0.as_path_list", "110")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_list_profile_parcel.test", "as_path_list_id", "1")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_as_path_list_profile_parcel.test", "entries.0.as_path_list", "110")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectASPathPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectASPathProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectASPathListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,15 +50,15 @@ func TestAccDataSourceSdwanPolicyObjectASPathProfileParcel(t *testing.T) { // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectASPathPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectASPathProfileParcelConfig() string { - config := `resource "sdwan_policy_object_as_path_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectASPathListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_as_path_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -69,8 +69,8 @@ func testAccDataSourceSdwanPolicyObjectASPathProfileParcelConfig() string { config += `}` + "\n" config += ` - data "sdwan_policy_object_as_path_profile_parcel" "test" { - id = sdwan_policy_object_as_path_profile_parcel.test.id + data "sdwan_policy_object_as_path_list_profile_parcel" "test" { + id = sdwan_policy_object_as_path_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go new file mode 100644 index 000000000..ba408be24 --- /dev/null +++ b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go @@ -0,0 +1,138 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "context" + "fmt" + "net/url" + + "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/netascode/go-sdwan" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin model + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource{} +) + +func NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource{} +} + +type PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource struct { + client *sdwan.Client +} + +func (d *PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_data_ipv4_prefix_list_profile_parcel" +} + +func (d *PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "This data source can read the Policy Object Security Data IPv4 Prefix List profile parcel.", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: "The id of the profile parcel", + Required: true, + }, + "version": schema.Int64Attribute{ + MarkdownDescription: "The version of the profile parcel", + Computed: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The name of the profile parcel", + Computed: true, + }, + "description": schema.StringAttribute{ + MarkdownDescription: "The description of the profile parcel", + Computed: true, + }, + "feature_profile_id": schema.StringAttribute{ + MarkdownDescription: "Feature Profile ID", + Required: true, + }, + "entries": schema.ListNestedAttribute{ + MarkdownDescription: "", + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "ip_prefix": schema.StringAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "ip_prefix_variable": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func (d *PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + d.client = req.ProviderData.(*SdwanProviderData).Client +} + +// End of section. //template:end model + +// Section below is generated&owned by "gen/generator.go". //template:begin read +func (d *PolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityDataIPv4PrefixList + + // Read config + diags := req.Config.Get(ctx, &config) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", config.Id.String())) + + res, err := d.client.Get(config.getPath() + "/" + url.QueryEscape(config.Id.ValueString())) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object, got error: %s", err)) + return + } + + config.fromBody(ctx, res) + + tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", config.Name.ValueString())) + + diags = resp.State.Set(ctx, &config) + resp.Diagnostics.Append(diags...) +} + +// End of section. //template:end read diff --git a/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go new file mode 100644 index 000000000..27e4740d8 --- /dev/null +++ b/internal/provider/data_source_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go @@ -0,0 +1,78 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource +func TestAccDataSourceSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcel(t *testing.T) { + if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { + t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") + } + var checks []resource.TestCheckFunc + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.test", "entries.0.ip_prefix", "10.0.0.0/12")) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSdwanPolicyObjectSecurityDataIPv4PrefixListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcelConfig(), + Check: resource.ComposeTestCheckFunc(checks...), + }, + }, + }) +} + +// End of section. //template:end testAccDataSource + +// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccDataSourceSdwanPolicyObjectSecurityDataIPv4PrefixListPrerequisitesProfileParcelConfig = ` +variable "policy_object_feature_template_id" {} +` + +// End of section. //template:end testPrerequisites + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig +func testAccDataSourceSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "test" {` + "\n" + config += ` name = "TF_TEST"` + "\n" + config += ` description = "Terraform integration test"` + "\n" + config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" + config += ` entries = [{` + "\n" + config += ` ip_prefix = "10.0.0.0/12"` + "\n" + config += ` }]` + "\n" + config += `}` + "\n" + + config += ` + data "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "test" { + id = sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.test.id + feature_profile_id = var.policy_object_feature_template_id + } + ` + return config +} + +// End of section. //template:end testAccDataSourceConfig diff --git a/internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel.go similarity index 80% rename from internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel.go index 191a120d7..a7e1230b9 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityLocalappProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityLocalappProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityFQDNListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityFQDNListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityLocalappProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityLocalappProfileParcelDataSource{} +func NewPolicyObjectSecurityFQDNListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityFQDNListProfileParcelDataSource{} } -type PolicyObjectSecurityLocalappProfileParcelDataSource struct { +type PolicyObjectSecurityFQDNListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_localapp_profile_parcel" +func (d *PolicyObjectSecurityFQDNListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_list_profile_parcel" } -func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityFQDNListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Localapp profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security FQDN List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -78,15 +78,11 @@ func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Schema(ctx context Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: "Localapp list", + MarkdownDescription: "", Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "app": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, - "app_family": schema.StringAttribute{ + "pattern": schema.StringAttribute{ MarkdownDescription: "", Computed: true, }, @@ -97,7 +93,7 @@ func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Schema(ctx context } } -func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityFQDNListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +104,8 @@ func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Configure(_ contex // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityLocalappProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityLocalapp +func (d *PolicyObjectSecurityFQDNListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityFQDNList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go similarity index 78% rename from internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go index de259438e..9c05d2dce 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityIdentityProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_identity_profile_parcel.test", "entries.0.user", "administrator")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_fqdn_list_profile_parcel.test", "entries.0.pattern", "cisco.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityIdentityPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIdentityProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,26 +49,26 @@ func TestAccDataSourceSdwanPolicyObjectSecurityIdentityProfileParcel(t *testing. // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityIdentityPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityIdentityProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_identity_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityFQDNListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_fqdn_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` user = "administrator"` + "\n" + config += ` pattern = "cisco.com"` + "\n" config += ` }]` + "\n" config += `}` + "\n" config += ` - data "sdwan_policy_object_security_identity_profile_parcel" "test" { - id = sdwan_policy_object_security_identity_profile_parcel.test.id + data "sdwan_policy_object_security_fqdn_list_profile_parcel" "test" { + id = sdwan_policy_object_security_fqdn_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel.go deleted file mode 100644 index 688ba3a38..000000000 --- a/internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "context" - "fmt" - "net/url" - - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/datasource/schema" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/netascode/go-sdwan" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin model - -// Ensure the implementation satisfies the expected interfaces. -var ( - _ datasource.DataSource = &PolicyObjectSecurityFQDNProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityFQDNProfileParcelDataSource{} -) - -func NewPolicyObjectSecurityFQDNProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityFQDNProfileParcelDataSource{} -} - -type PolicyObjectSecurityFQDNProfileParcelDataSource struct { - client *sdwan.Client -} - -func (d *PolicyObjectSecurityFQDNProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_profile_parcel" -} - -func (d *PolicyObjectSecurityFQDNProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { - resp.Schema = schema.Schema{ - // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security FQDN profile parcel.", - - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - MarkdownDescription: "The id of the profile parcel", - Required: true, - }, - "version": schema.Int64Attribute{ - MarkdownDescription: "The version of the profile parcel", - Computed: true, - }, - "name": schema.StringAttribute{ - MarkdownDescription: "The name of the profile parcel", - Computed: true, - }, - "description": schema.StringAttribute{ - MarkdownDescription: "The description of the profile parcel", - Computed: true, - }, - "feature_profile_id": schema.StringAttribute{ - MarkdownDescription: "Feature Profile ID", - Required: true, - }, - "entries": schema.ListNestedAttribute{ - MarkdownDescription: "", - Computed: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "pattern": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, - }, - }, - }, - }, - } -} - -func (d *PolicyObjectSecurityFQDNProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { - if req.ProviderData == nil { - return - } - - d.client = req.ProviderData.(*SdwanProviderData).Client -} - -// End of section. //template:end model - -// Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityFQDNProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityFQDN - - // Read config - diags := req.Config.Get(ctx, &config) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", config.Id.String())) - - res, err := d.client.Get(config.getPath() + "/" + url.QueryEscape(config.Id.ValueString())) - if err != nil { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object, got error: %s", err)) - return - } - - config.fromBody(ctx, res) - - tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", config.Name.ValueString())) - - diags = resp.State.Set(ctx, &config) - resp.Diagnostics.Append(diags...) -} - -// End of section. //template:end read diff --git a/internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel.go similarity index 77% rename from internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel.go index de8a49c36..4ac1a3d60 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityGeolocationProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityGeolocationProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityGeolocationListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityGeolocationListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityGeolocationProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityGeolocationProfileParcelDataSource{} +func NewPolicyObjectSecurityGeolocationListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityGeolocationListProfileParcelDataSource{} } -type PolicyObjectSecurityGeolocationProfileParcelDataSource struct { +type PolicyObjectSecurityGeolocationListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_profile_parcel" +func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_list_profile_parcel" } -func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Geolocation profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security Geolocation List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -97,7 +97,7 @@ func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Schema(ctx cont } } -func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +108,8 @@ func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Configure(_ con // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityGeolocationProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityGeolocation +func (d *PolicyObjectSecurityGeolocationListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityGeolocationList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go similarity index 76% rename from internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go index e6a65f487..1e0117111 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_geolocation_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityGeolocationProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_geolocation_profile_parcel.test", "entries.0.country", "DZA")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_geolocation_list_profile_parcel.test", "entries.0.country", "DZA")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityGeolocationPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityGeolocationProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,15 +49,15 @@ func TestAccDataSourceSdwanPolicyObjectSecurityGeolocationProfileParcel(t *testi // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityGeolocationPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityGeolocationProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_geolocation_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_geolocation_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -67,8 +67,8 @@ func testAccDataSourceSdwanPolicyObjectSecurityGeolocationProfileParcelConfig() config += `}` + "\n" config += ` - data "sdwan_policy_object_security_geolocation_profile_parcel" "test" { - id = sdwan_policy_object_security_geolocation_profile_parcel.test.id + data "sdwan_policy_object_security_geolocation_list_profile_parcel" "test" { + id = sdwan_policy_object_security_geolocation_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel.go similarity index 78% rename from internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel.go index b23bc373a..8ad0d7cc3 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel.go @@ -23,7 +23,6 @@ import ( "fmt" "net/url" - "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/datasource/schema" "github.com/hashicorp/terraform-plugin-log/tflog" @@ -36,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityDataIPPrefixProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityDataIPPrefixProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityIdentityListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIdentityListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityDataIPPrefixProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityDataIPPrefixProfileParcelDataSource{} +func NewPolicyObjectSecurityIdentityListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityIdentityListProfileParcelDataSource{} } -type PolicyObjectSecurityDataIPPrefixProfileParcelDataSource struct { +type PolicyObjectSecurityIdentityListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_data_ip_prefix_profile_parcel" +func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_list_profile_parcel" } -func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Data IP Prefix profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security Identity List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -79,16 +78,16 @@ func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Schema(ctx con Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: "", + MarkdownDescription: "Array of Users and User Groups", Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "ip_prefix": schema.StringAttribute{ + "user": schema.StringAttribute{ MarkdownDescription: "", Computed: true, }, - "ip_prefix_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, + "user_group": schema.StringAttribute{ + MarkdownDescription: "", Computed: true, }, }, @@ -98,7 +97,7 @@ func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Schema(ctx con } } -func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -109,8 +108,8 @@ func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Configure(_ co // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityDataIPPrefixProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityDataIPPrefix +func (d *PolicyObjectSecurityIdentityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityIdentityList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel_test.go similarity index 75% rename from internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel_test.go index bb2044059..1436c6227 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_identity_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_data_ip_prefix_profile_parcel.test", "entries.0.ip_prefix", "10.0.0.0/12")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_identity_list_profile_parcel.test", "entries.0.user", "administrator")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,26 +49,26 @@ func TestAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixProfileParcel(t *test // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityDataIPPrefixProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityIdentityListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_identity_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` ip_prefix = "10.0.0.0/12"` + "\n" + config += ` user = "administrator"` + "\n" config += ` }]` + "\n" config += `}` + "\n" config += ` - data "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "test" { - id = sdwan_policy_object_security_data_ip_prefix_profile_parcel.test.id + data "sdwan_policy_object_security_identity_list_profile_parcel" "test" { + id = sdwan_policy_object_security_identity_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel.go index 0520b3784..c0fa16baa 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityIPsSignatureProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIPsSignatureProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{} ) -func NewPolicyObjectSecurityIPsSignatureProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityIPsSignatureProfileParcelDataSource{} +func NewPolicyObjectSecurityIPSSignatureProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityIPSSignatureProfileParcelDataSource{} } -type PolicyObjectSecurityIPsSignatureProfileParcelDataSource struct { +type PolicyObjectSecurityIPSSignatureProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { +func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_policy_object_security_ips_signature_profile_parcel" } -func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security IPs Signature profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security IPS Signature profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -97,7 +97,7 @@ func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Schema(ctx con } } -func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +108,8 @@ func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Configure(_ co // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityIPsSignatureProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityIPsSignature +func (d *PolicyObjectSecurityIPSSignatureProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityIPSSignature // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel_test.go index 20a269d88..b81104d40 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_ips_signature_profile_parcel_test.go @@ -28,7 +28,7 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } @@ -40,7 +40,7 @@ func TestAccDataSourceSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *test ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityIPsSignaturePrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIPsSignatureProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,14 +50,14 @@ func TestAccDataSourceSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *test // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityIPsSignaturePrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityIPsSignatureProfileParcelConfig() string { +func testAccDataSourceSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig() string { config := `resource "sdwan_policy_object_security_ips_signature_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" diff --git a/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel.go new file mode 100644 index 000000000..956556f66 --- /dev/null +++ b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel.go @@ -0,0 +1,137 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "context" + "fmt" + "net/url" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/datasource/schema" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/netascode/go-sdwan" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin model + +// Ensure the implementation satisfies the expected interfaces. +var ( + _ datasource.DataSource = &PolicyObjectSecurityLocalApplicationListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityLocalApplicationListProfileParcelDataSource{} +) + +func NewPolicyObjectSecurityLocalApplicationListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityLocalApplicationListProfileParcelDataSource{} +} + +type PolicyObjectSecurityLocalApplicationListProfileParcelDataSource struct { + client *sdwan.Client +} + +func (d *PolicyObjectSecurityLocalApplicationListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_application_list_profile_parcel" +} + +func (d *PolicyObjectSecurityLocalApplicationListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: "This data source can read the Policy Object Security Local Application List profile parcel.", + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: "The id of the profile parcel", + Required: true, + }, + "version": schema.Int64Attribute{ + MarkdownDescription: "The version of the profile parcel", + Computed: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The name of the profile parcel", + Computed: true, + }, + "description": schema.StringAttribute{ + MarkdownDescription: "The description of the profile parcel", + Computed: true, + }, + "feature_profile_id": schema.StringAttribute{ + MarkdownDescription: "Feature Profile ID", + Required: true, + }, + "entries": schema.ListNestedAttribute{ + MarkdownDescription: "Localapp list", + Computed: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "app": schema.StringAttribute{ + MarkdownDescription: "", + Computed: true, + }, + "app_family": schema.StringAttribute{ + MarkdownDescription: "", + Computed: true, + }, + }, + }, + }, + }, + } +} + +func (d *PolicyObjectSecurityLocalApplicationListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + d.client = req.ProviderData.(*SdwanProviderData).Client +} + +// End of section. //template:end model + +// Section below is generated&owned by "gen/generator.go". //template:begin read +func (d *PolicyObjectSecurityLocalApplicationListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityLocalApplicationList + + // Read config + diags := req.Config.Get(ctx, &config) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", config.Id.String())) + + res, err := d.client.Get(config.getPath() + "/" + url.QueryEscape(config.Id.ValueString())) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object, got error: %s", err)) + return + } + + config.fromBody(ctx, res) + + tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", config.Name.ValueString())) + + diags = resp.State.Set(ctx, &config) + resp.Diagnostics.Append(diags...) +} + +// End of section. //template:end read diff --git a/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel_test.go new file mode 100644 index 000000000..5911a94a7 --- /dev/null +++ b/internal/provider/data_source_sdwan_policy_object_security_local_application_list_profile_parcel_test.go @@ -0,0 +1,78 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource +func TestAccDataSourceSdwanPolicyObjectSecurityLocalApplicationListProfileParcel(t *testing.T) { + if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { + t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") + } + var checks []resource.TestCheckFunc + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_local_application_list_profile_parcel.test", "entries.0.app", "audible-com")) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSdwanPolicyObjectSecurityLocalApplicationListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityLocalApplicationListProfileParcelConfig(), + Check: resource.ComposeTestCheckFunc(checks...), + }, + }, + }) +} + +// End of section. //template:end testAccDataSource + +// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccDataSourceSdwanPolicyObjectSecurityLocalApplicationListPrerequisitesProfileParcelConfig = ` +variable "policy_object_feature_template_id" {} +` + +// End of section. //template:end testPrerequisites + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig +func testAccDataSourceSdwanPolicyObjectSecurityLocalApplicationListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_local_application_list_profile_parcel" "test" {` + "\n" + config += ` name = "TF_TEST"` + "\n" + config += ` description = "Terraform integration test"` + "\n" + config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" + config += ` entries = [{` + "\n" + config += ` app = "audible-com"` + "\n" + config += ` }]` + "\n" + config += `}` + "\n" + + config += ` + data "sdwan_policy_object_security_local_application_list_profile_parcel" "test" { + id = sdwan_policy_object_security_local_application_list_profile_parcel.test.id + feature_profile_id = var.policy_object_feature_template_id + } + ` + return config +} + +// End of section. //template:end testAccDataSourceConfig diff --git a/internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel.go similarity index 75% rename from internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel.go index b52b65306..66fe3345f 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityLocaldomainProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityLocaldomainProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityLocaldomainProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityLocaldomainProfileParcelDataSource{} +func NewPolicyObjectSecurityLocalDomainListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityLocalDomainListProfileParcelDataSource{} } -type PolicyObjectSecurityLocaldomainProfileParcelDataSource struct { +type PolicyObjectSecurityLocalDomainListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_localdomain_profile_parcel" +func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_domain_list_profile_parcel" } -func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Localdomain profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security Local Domain List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -82,7 +82,7 @@ func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Schema(ctx cont Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "name_server": schema.StringAttribute{ + "local_domain": schema.StringAttribute{ MarkdownDescription: "", Computed: true, }, @@ -93,7 +93,7 @@ func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Schema(ctx cont } } -func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -104,8 +104,8 @@ func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Configure(_ con // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityLocaldomainProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityLocaldomain +func (d *PolicyObjectSecurityLocalDomainListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityLocalDomainList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go similarity index 72% rename from internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go index bbb5ee4fa..03004b2bc 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_fqdn_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityFQDNProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_fqdn_profile_parcel.test", "entries.0.pattern", "cisco.com")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_local_domain_list_profile_parcel.test", "entries.0.local_domain", "hello.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityFQDNPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityFQDNProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,26 +49,26 @@ func TestAccDataSourceSdwanPolicyObjectSecurityFQDNProfileParcel(t *testing.T) { // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityFQDNPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityFQDNProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_fqdn_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_local_domain_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` pattern = "cisco.com"` + "\n" + config += ` local_domain = "hello.com"` + "\n" config += ` }]` + "\n" config += `}` + "\n" config += ` - data "sdwan_policy_object_security_fqdn_profile_parcel" "test" { - id = sdwan_policy_object_security_fqdn_profile_parcel.test.id + data "sdwan_policy_object_security_local_domain_list_profile_parcel" "test" { + id = sdwan_policy_object_security_local_domain_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel_test.go deleted file mode 100644 index 2d1f910c1..000000000 --- a/internal/provider/data_source_sdwan_policy_object_security_localdomain_profile_parcel_test.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "os" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityLocaldomainProfileParcel(t *testing.T) { - if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { - t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") - } - var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_localdomain_profile_parcel.test", "entries.0.name_server", "hello.com")) - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccDataSourceSdwanPolicyObjectSecurityLocaldomainPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityLocaldomainProfileParcelConfig(), - Check: resource.ComposeTestCheckFunc(checks...), - }, - }, - }) -} - -// End of section. //template:end testAccDataSource - -// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityLocaldomainPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} -` - -// End of section. //template:end testPrerequisites - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityLocaldomainProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_localdomain_profile_parcel" "test" {` + "\n" - config += ` name = "TF_TEST"` + "\n" - config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" - config += ` entries = [{` + "\n" - config += ` name_server = "hello.com"` + "\n" - config += ` }]` + "\n" - config += `}` + "\n" - - config += ` - data "sdwan_policy_object_security_localdomain_profile_parcel" "test" { - id = sdwan_policy_object_security_localdomain_profile_parcel.test.id - feature_profile_id = var.policy_object_feature_template_id - } - ` - return config -} - -// End of section. //template:end testAccDataSourceConfig diff --git a/internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel.go similarity index 79% rename from internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel.go index 8c02aae23..95f402017 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_identity_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityIdentityProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityIdentityProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityPortListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityPortListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityIdentityProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityIdentityProfileParcelDataSource{} +func NewPolicyObjectSecurityPortListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityPortListProfileParcelDataSource{} } -type PolicyObjectSecurityIdentityProfileParcelDataSource struct { +type PolicyObjectSecurityPortListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_profile_parcel" +func (d *PolicyObjectSecurityPortListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_list_profile_parcel" } -func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityPortListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Identity profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security Port List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -78,16 +78,12 @@ func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Schema(ctx context Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: "Array of Users and User Groups", + MarkdownDescription: "Port List", Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "user": schema.StringAttribute{ - MarkdownDescription: "", - Computed: true, - }, - "user_group": schema.StringAttribute{ - MarkdownDescription: "", + "port": schema.StringAttribute{ + MarkdownDescription: "can be single port or port range", Computed: true, }, }, @@ -97,7 +93,7 @@ func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Schema(ctx context } } -func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityPortListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +104,8 @@ func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Configure(_ contex // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityIdentityProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityIdentity +func (d *PolicyObjectSecurityPortListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityPortList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel_test.go similarity index 78% rename from internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel_test.go index 146ed693d..07c8851d8 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_localapp_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_port_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityLocalappProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_localapp_profile_parcel.test", "entries.0.app", "audible-com")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_port_list_profile_parcel.test", "entries.0.port", "100")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityLocalappPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityLocalappProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,26 +49,26 @@ func TestAccDataSourceSdwanPolicyObjectSecurityLocalappProfileParcel(t *testing. // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityLocalappPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityLocalappProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_localapp_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityPortListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_port_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` app = "audible-com"` + "\n" + config += ` port = "100"` + "\n" config += ` }]` + "\n" config += `}` + "\n" config += ` - data "sdwan_policy_object_security_localapp_profile_parcel" "test" { - id = sdwan_policy_object_security_localapp_profile_parcel.test.id + data "sdwan_policy_object_security_port_list_profile_parcel" "test" { + id = sdwan_policy_object_security_port_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel.go deleted file mode 100644 index 838040c76..000000000 --- a/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "context" - "fmt" - "net/url" - - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/datasource/schema" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/netascode/go-sdwan" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin model - -// Ensure the implementation satisfies the expected interfaces. -var ( - _ datasource.DataSource = &PolicyObjectSecurityPortProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityPortProfileParcelDataSource{} -) - -func NewPolicyObjectSecurityPortProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityPortProfileParcelDataSource{} -} - -type PolicyObjectSecurityPortProfileParcelDataSource struct { - client *sdwan.Client -} - -func (d *PolicyObjectSecurityPortProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_profile_parcel" -} - -func (d *PolicyObjectSecurityPortProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { - resp.Schema = schema.Schema{ - // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Port profile parcel.", - - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - MarkdownDescription: "The id of the profile parcel", - Required: true, - }, - "version": schema.Int64Attribute{ - MarkdownDescription: "The version of the profile parcel", - Computed: true, - }, - "name": schema.StringAttribute{ - MarkdownDescription: "The name of the profile parcel", - Computed: true, - }, - "description": schema.StringAttribute{ - MarkdownDescription: "The description of the profile parcel", - Computed: true, - }, - "feature_profile_id": schema.StringAttribute{ - MarkdownDescription: "Feature Profile ID", - Required: true, - }, - "entries": schema.ListNestedAttribute{ - MarkdownDescription: "Port List", - Computed: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "port": schema.StringAttribute{ - MarkdownDescription: "can be single port or port range", - Computed: true, - }, - }, - }, - }, - }, - } -} - -func (d *PolicyObjectSecurityPortProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { - if req.ProviderData == nil { - return - } - - d.client = req.ProviderData.(*SdwanProviderData).Client -} - -// End of section. //template:end model - -// Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityPortProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityPort - - // Read config - diags := req.Config.Get(ctx, &config) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", config.Id.String())) - - res, err := d.client.Get(config.getPath() + "/" + url.QueryEscape(config.Id.ValueString())) - if err != nil { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object, got error: %s", err)) - return - } - - config.fromBody(ctx, res) - - tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", config.Name.ValueString())) - - diags = resp.State.Set(ctx, &config) - resp.Diagnostics.Append(diags...) -} - -// End of section. //template:end read diff --git a/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel_test.go deleted file mode 100644 index 723eafa02..000000000 --- a/internal/provider/data_source_sdwan_policy_object_security_port_profile_parcel_test.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "os" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityPortProfileParcel(t *testing.T) { - if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { - t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") - } - var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_port_profile_parcel.test", "entries.0.port", "100")) - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - { - Config: testAccDataSourceSdwanPolicyObjectSecurityPortPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityPortProfileParcelConfig(), - Check: resource.ComposeTestCheckFunc(checks...), - }, - }, - }) -} - -// End of section. //template:end testAccDataSource - -// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityPortPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} -` - -// End of section. //template:end testPrerequisites - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityPortProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_port_profile_parcel" "test" {` + "\n" - config += ` name = "TF_TEST"` + "\n" - config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" - config += ` entries = [{` + "\n" - config += ` port = "100"` + "\n" - config += ` }]` + "\n" - config += `}` + "\n" - - config += ` - data "sdwan_policy_object_security_port_profile_parcel" "test" { - id = sdwan_policy_object_security_port_profile_parcel.test.id - feature_profile_id = var.policy_object_feature_template_id - } - ` - return config -} - -// End of section. //template:end testAccDataSourceConfig diff --git a/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go similarity index 76% rename from internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go index ee744d296..b6e0ed688 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityScalableGroupTagProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityScalableGroupTagProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityScalableGroupTagProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityScalableGroupTagProfileParcelDataSource{} +func NewPolicyObjectSecurityScalableGroupTagListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource{} } -type PolicyObjectSecurityScalableGroupTagProfileParcelDataSource struct { +type PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_profile_parcel" +func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_list_profile_parcel" } -func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security Scalable Group Tag profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security Scalable Group Tag List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -97,7 +97,7 @@ func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Schema(ctx } } -func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -108,8 +108,8 @@ func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Configure( // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityScalableGroupTagProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityScalableGroupTag +func (d *PolicyObjectSecurityScalableGroupTagListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityScalableGroupTagList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go similarity index 77% rename from internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go index e3bcd19b7..5eb3105f7 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_profile_parcel.test", "entries.0.sgt_name", "ANY")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_profile_parcel.test", "entries.0.tag", "65535")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.test", "entries.0.sgt_name", "ANY")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.test", "entries.0.tag", "65535")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,15 +50,15 @@ func TestAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagProfileParcel(t * // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -69,8 +69,8 @@ func testAccDataSourceSdwanPolicyObjectSecurityScalableGroupTagProfileParcelConf config += `}` + "\n" config += ` - data "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "test" { - id = sdwan_policy_object_security_scalable_group_tag_profile_parcel.test.id + data "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "test" { + id = sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel.go similarity index 86% rename from internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel.go index 17898e14e..d5158598a 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectSecurityURLlistProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityURLlistProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectSecurityURLListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectSecurityURLListProfileParcelDataSource{} ) -func NewPolicyObjectSecurityURLlistProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectSecurityURLlistProfileParcelDataSource{} +func NewPolicyObjectSecurityURLListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectSecurityURLListProfileParcelDataSource{} } -type PolicyObjectSecurityURLlistProfileParcelDataSource struct { +type PolicyObjectSecurityURLListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_urllist_profile_parcel" +func (d *PolicyObjectSecurityURLListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_url_list_profile_parcel" } -func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectSecurityURLListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Security URLlist profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Security URL List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -93,7 +93,7 @@ func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Schema(ctx context. } } -func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectSecurityURLListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -104,8 +104,8 @@ func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Configure(_ context // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectSecurityURLlistProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectSecurityURLlist +func (d *PolicyObjectSecurityURLListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectSecurityURLList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel_test.go similarity index 80% rename from internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel_test.go index f34311881..e6259f0d5 100644 --- a/internal/provider/data_source_sdwan_policy_object_security_urllist_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_security_url_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectSecurityURLlistProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectSecurityURLListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_urllist_profile_parcel.test", "entries.0.pattern", "www.cisco.com")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_security_url_list_profile_parcel.test", "entries.0.pattern", "www.cisco.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectSecurityURLlistPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityURLlistProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectSecurityURLListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,15 +49,15 @@ func TestAccDataSourceSdwanPolicyObjectSecurityURLlistProfileParcel(t *testing.T // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectSecurityURLlistPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectSecurityURLlistProfileParcelConfig() string { - config := `resource "sdwan_policy_object_security_urllist_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectSecurityURLListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_security_url_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -67,8 +67,8 @@ func testAccDataSourceSdwanPolicyObjectSecurityURLlistProfileParcelConfig() stri config += `}` + "\n" config += ` - data "sdwan_policy_object_security_urllist_profile_parcel" "test" { - id = sdwan_policy_object_security_urllist_profile_parcel.test.id + data "sdwan_policy_object_security_url_list_profile_parcel" "test" { + id = sdwan_policy_object_security_url_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel.go b/internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel.go similarity index 77% rename from internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel.go rename to internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel.go index d4227a781..997d3f9a1 100644 --- a/internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel.go +++ b/internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel.go @@ -35,26 +35,26 @@ import ( // Ensure the implementation satisfies the expected interfaces. var ( - _ datasource.DataSource = &PolicyObjectStandardCommunityProfileParcelDataSource{} - _ datasource.DataSourceWithConfigure = &PolicyObjectStandardCommunityProfileParcelDataSource{} + _ datasource.DataSource = &PolicyObjectStandardCommunityListProfileParcelDataSource{} + _ datasource.DataSourceWithConfigure = &PolicyObjectStandardCommunityListProfileParcelDataSource{} ) -func NewPolicyObjectStandardCommunityProfileParcelDataSource() datasource.DataSource { - return &PolicyObjectStandardCommunityProfileParcelDataSource{} +func NewPolicyObjectStandardCommunityListProfileParcelDataSource() datasource.DataSource { + return &PolicyObjectStandardCommunityListProfileParcelDataSource{} } -type PolicyObjectStandardCommunityProfileParcelDataSource struct { +type PolicyObjectStandardCommunityListProfileParcelDataSource struct { client *sdwan.Client } -func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_profile_parcel" +func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) Metadata(_ context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_list_profile_parcel" } -func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { +func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: "This data source can read the Policy Object Standard Community profile parcel.", + MarkdownDescription: "This data source can read the Policy Object Standard Community List profile parcel.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -93,7 +93,7 @@ func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Schema(ctx contex } } -func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { +func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) Configure(_ context.Context, req datasource.ConfigureRequest, _ *datasource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -104,8 +104,8 @@ func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Configure(_ conte // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin read -func (d *PolicyObjectStandardCommunityProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { - var config PolicyObjectStandardCommunity +func (d *PolicyObjectStandardCommunityListProfileParcelDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse) { + var config PolicyObjectStandardCommunityList // Read config diags := req.Config.Get(ctx, &config) diff --git a/internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel_test.go b/internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel_test.go similarity index 74% rename from internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel_test.go rename to internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel_test.go index fdb1e0d8c..2760deadc 100644 --- a/internal/provider/data_source_sdwan_policy_object_standard_community_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_policy_object_standard_community_list_profile_parcel_test.go @@ -28,18 +28,18 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource -func TestAccDataSourceSdwanPolicyObjectStandardCommunityProfileParcel(t *testing.T) { +func TestAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_standard_community_profile_parcel.test", "entries.0.standard_community", "1000:10000")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_policy_object_standard_community_list_profile_parcel.test", "entries.0.standard_community", "1000:10000")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccDataSourceSdwanPolicyObjectStandardCommunityPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectStandardCommunityProfileParcelConfig(), + Config: testAccDataSourceSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig + testAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcelConfig(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -49,15 +49,15 @@ func TestAccDataSourceSdwanPolicyObjectStandardCommunityProfileParcel(t *testing // End of section. //template:end testAccDataSource // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccDataSourceSdwanPolicyObjectStandardCommunityPrerequisitesProfileParcelConfig = ` +const testAccDataSourceSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` // End of section. //template:end testPrerequisites // Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig -func testAccDataSourceSdwanPolicyObjectStandardCommunityProfileParcelConfig() string { - config := `resource "sdwan_policy_object_standard_community_profile_parcel" "test" {` + "\n" +func testAccDataSourceSdwanPolicyObjectStandardCommunityListProfileParcelConfig() string { + config := `resource "sdwan_policy_object_standard_community_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" @@ -67,8 +67,8 @@ func testAccDataSourceSdwanPolicyObjectStandardCommunityProfileParcelConfig() st config += `}` + "\n" config += ` - data "sdwan_policy_object_standard_community_profile_parcel" "test" { - id = sdwan_policy_object_standard_community_profile_parcel.test.id + data "sdwan_policy_object_standard_community_list_profile_parcel" "test" { + id = sdwan_policy_object_standard_community_list_profile_parcel.test.id feature_profile_id = var.policy_object_feature_template_id } ` diff --git a/internal/provider/model_sdwan_policy_object_app_probe_profile_parcel.go b/internal/provider/model_sdwan_policy_object_app_probe_class_profile_parcel.go similarity index 83% rename from internal/provider/model_sdwan_policy_object_app_probe_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_app_probe_class_profile_parcel.go index a5df03ce5..4ae2ec03a 100644 --- a/internal/provider/model_sdwan_policy_object_app_probe_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_app_probe_class_profile_parcel.go @@ -31,21 +31,21 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectAppProbe struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectAppProbeEntries `tfsdk:"entries"` +type PolicyObjectAppProbeClass struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectAppProbeClassEntries `tfsdk:"entries"` } -type PolicyObjectAppProbeEntries struct { - Map []PolicyObjectAppProbeEntriesMap `tfsdk:"map"` - ForwardingClass types.String `tfsdk:"forwarding_class"` +type PolicyObjectAppProbeClassEntries struct { + Map []PolicyObjectAppProbeClassEntriesMap `tfsdk:"map"` + ForwardingClass types.String `tfsdk:"forwarding_class"` } -type PolicyObjectAppProbeEntriesMap struct { +type PolicyObjectAppProbeClassEntriesMap struct { Color types.String `tfsdk:"color"` Dscp types.Int64 `tfsdk:"dscp"` } @@ -53,21 +53,21 @@ type PolicyObjectAppProbeEntriesMap struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectAppProbe) getModel() string { - return "policy_object_app_probe" +func (data PolicyObjectAppProbeClass) getModel() string { + return "policy_object_app_probe_class" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectAppProbe) getPath() string { +func (data PolicyObjectAppProbeClass) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/app-probe", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectAppProbe) toBody(ctx context.Context) string { +func (data PolicyObjectAppProbeClass) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -110,7 +110,7 @@ func (data PolicyObjectAppProbe) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectAppProbe) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectAppProbeClass) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -119,13 +119,13 @@ func (data *PolicyObjectAppProbe) fromBody(ctx context.Context, res gjson.Result } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectAppProbeEntries, 0) + data.Entries = make([]PolicyObjectAppProbeClassEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectAppProbeEntries{} + item := PolicyObjectAppProbeClassEntries{} if cValue := v.Get("map"); cValue.Exists() { - item.Map = make([]PolicyObjectAppProbeEntriesMap, 0) + item.Map = make([]PolicyObjectAppProbeClassEntriesMap, 0) cValue.ForEach(func(ck, cv gjson.Result) bool { - cItem := PolicyObjectAppProbeEntriesMap{} + cItem := PolicyObjectAppProbeClassEntriesMap{} cItem.Color = types.StringNull() if t := cv.Get("color.optionType"); t.Exists() { @@ -163,7 +163,7 @@ func (data *PolicyObjectAppProbe) fromBody(ctx context.Context, res gjson.Result // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectAppProbe) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectAppProbeClass) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -260,7 +260,7 @@ func (data *PolicyObjectAppProbe) updateFromBody(ctx context.Context, res gjson. // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectAppProbe) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectAppProbeClass) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_as_path_profile_parcel.go b/internal/provider/model_sdwan_policy_object_as_path_list_profile_parcel.go similarity index 82% rename from internal/provider/model_sdwan_policy_object_as_path_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_as_path_list_profile_parcel.go index 50948678f..936f3d632 100644 --- a/internal/provider/model_sdwan_policy_object_as_path_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_as_path_list_profile_parcel.go @@ -31,38 +31,38 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectASPath struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - AsPathListId types.Int64 `tfsdk:"as_path_list_id"` - Entries []PolicyObjectASPathEntries `tfsdk:"entries"` +type PolicyObjectASPathList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + AsPathListId types.Int64 `tfsdk:"as_path_list_id"` + Entries []PolicyObjectASPathListEntries `tfsdk:"entries"` } -type PolicyObjectASPathEntries struct { +type PolicyObjectASPathListEntries struct { AsPathList types.String `tfsdk:"as_path_list"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectASPath) getModel() string { - return "policy_object_as_path" +func (data PolicyObjectASPathList) getModel() string { + return "policy_object_as_path_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectASPath) getPath() string { +func (data PolicyObjectASPathList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/as-path", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectASPath) toBody(ctx context.Context) string { +func (data PolicyObjectASPathList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectASPath) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectASPath) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectASPathList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -109,9 +109,9 @@ func (data *PolicyObjectASPath) fromBody(ctx context.Context, res gjson.Result) } } if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectASPathEntries, 0) + data.Entries = make([]PolicyObjectASPathListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectASPathEntries{} + item := PolicyObjectASPathListEntries{} item.AsPathList = types.StringNull() if t := v.Get("asPath.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectASPath) fromBody(ctx context.Context, res gjson.Result) // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectASPath) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectASPathList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectASPath) updateFromBody(ctx context.Context, res gjson.Re // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectASPath) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectASPathList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go similarity index 80% rename from internal/provider/model_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go index 1d72528d5..db1739136 100644 --- a/internal/provider/model_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityDataIPPrefix struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityDataIPPrefixEntries `tfsdk:"entries"` +type PolicyObjectSecurityDataIPv4PrefixList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityDataIPv4PrefixListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityDataIPPrefixEntries struct { +type PolicyObjectSecurityDataIPv4PrefixListEntries struct { IpPrefix types.String `tfsdk:"ip_prefix"` IpPrefixVariable types.String `tfsdk:"ip_prefix_variable"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityDataIPPrefixEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityDataIPPrefix) getModel() string { - return "policy_object_security_data_ip_prefix" +func (data PolicyObjectSecurityDataIPv4PrefixList) getModel() string { + return "policy_object_security_data_ipv4_prefix_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityDataIPPrefix) getPath() string { +func (data PolicyObjectSecurityDataIPv4PrefixList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-data-ip-prefix", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityDataIPPrefix) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityDataIPv4PrefixList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityDataIPPrefix) toBody(ctx context.Context) string // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityDataIPPrefix) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityDataIPv4PrefixList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityDataIPPrefix) fromBody(ctx context.Context, res } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityDataIPPrefixEntries, 0) + data.Entries = make([]PolicyObjectSecurityDataIPv4PrefixListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityDataIPPrefixEntries{} + item := PolicyObjectSecurityDataIPv4PrefixListEntries{} item.IpPrefix = types.StringNull() item.IpPrefixVariable = types.StringNull() if t := v.Get("ipPrefix.optionType"); t.Exists() { @@ -123,7 +123,7 @@ func (data *PolicyObjectSecurityDataIPPrefix) fromBody(ctx context.Context, res // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityDataIPPrefix) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityDataIPv4PrefixList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -176,7 +176,7 @@ func (data *PolicyObjectSecurityDataIPPrefix) updateFromBody(ctx context.Context // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityDataIPPrefix) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityDataIPv4PrefixList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_fqdn_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_fqdn_list_profile_parcel.go similarity index 79% rename from internal/provider/model_sdwan_policy_object_security_fqdn_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_fqdn_list_profile_parcel.go index 323ada85e..ff8c2fb5c 100644 --- a/internal/provider/model_sdwan_policy_object_security_fqdn_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_fqdn_list_profile_parcel.go @@ -31,37 +31,37 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityFQDN struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityFQDNEntries `tfsdk:"entries"` +type PolicyObjectSecurityFQDNList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityFQDNListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityFQDNEntries struct { +type PolicyObjectSecurityFQDNListEntries struct { Pattern types.String `tfsdk:"pattern"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityFQDN) getModel() string { - return "policy_object_security_fqdn" +func (data PolicyObjectSecurityFQDNList) getModel() string { + return "policy_object_security_fqdn_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityFQDN) getPath() string { +func (data PolicyObjectSecurityFQDNList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-fqdn", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityFQDN) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityFQDNList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -85,7 +85,7 @@ func (data PolicyObjectSecurityFQDN) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityFQDN) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityFQDNList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -94,9 +94,9 @@ func (data *PolicyObjectSecurityFQDN) fromBody(ctx context.Context, res gjson.Re } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityFQDNEntries, 0) + data.Entries = make([]PolicyObjectSecurityFQDNListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityFQDNEntries{} + item := PolicyObjectSecurityFQDNListEntries{} item.Pattern = types.StringNull() if t := v.Get("pattern.optionType"); t.Exists() { @@ -114,7 +114,7 @@ func (data *PolicyObjectSecurityFQDN) fromBody(ctx context.Context, res gjson.Re // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityFQDN) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityFQDNList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -165,7 +165,7 @@ func (data *PolicyObjectSecurityFQDN) updateFromBody(ctx context.Context, res gj // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityFQDN) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityFQDNList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_geolocation_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_geolocation_list_profile_parcel.go similarity index 80% rename from internal/provider/model_sdwan_policy_object_security_geolocation_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_geolocation_list_profile_parcel.go index e881434a6..036e36390 100644 --- a/internal/provider/model_sdwan_policy_object_security_geolocation_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_geolocation_list_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityGeolocation struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityGeolocationEntries `tfsdk:"entries"` +type PolicyObjectSecurityGeolocationList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityGeolocationListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityGeolocationEntries struct { +type PolicyObjectSecurityGeolocationListEntries struct { Country types.String `tfsdk:"country"` Continent types.String `tfsdk:"continent"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityGeolocationEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityGeolocation) getModel() string { - return "policy_object_security_geolocation" +func (data PolicyObjectSecurityGeolocationList) getModel() string { + return "policy_object_security_geolocation_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityGeolocation) getPath() string { +func (data PolicyObjectSecurityGeolocationList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-geolocation", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityGeolocation) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityGeolocationList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityGeolocation) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityGeolocation) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityGeolocationList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityGeolocation) fromBody(ctx context.Context, res g } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityGeolocationEntries, 0) + data.Entries = make([]PolicyObjectSecurityGeolocationListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityGeolocationEntries{} + item := PolicyObjectSecurityGeolocationListEntries{} item.Country = types.StringNull() if t := v.Get("country.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectSecurityGeolocation) fromBody(ctx context.Context, res g // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityGeolocation) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityGeolocationList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectSecurityGeolocation) updateFromBody(ctx context.Context, // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityGeolocation) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityGeolocationList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_identity_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_identity_list_profile_parcel.go similarity index 81% rename from internal/provider/model_sdwan_policy_object_security_identity_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_identity_list_profile_parcel.go index 048831508..2e206d59c 100644 --- a/internal/provider/model_sdwan_policy_object_security_identity_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_identity_list_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityIdentity struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityIdentityEntries `tfsdk:"entries"` +type PolicyObjectSecurityIdentityList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityIdentityListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityIdentityEntries struct { +type PolicyObjectSecurityIdentityListEntries struct { User types.String `tfsdk:"user"` UserGroup types.String `tfsdk:"user_group"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityIdentityEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityIdentity) getModel() string { - return "policy_object_security_identity" +func (data PolicyObjectSecurityIdentityList) getModel() string { + return "policy_object_security_identity_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityIdentity) getPath() string { +func (data PolicyObjectSecurityIdentityList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-identity", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityIdentity) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityIdentityList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityIdentity) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityIdentity) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityIdentityList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityIdentity) fromBody(ctx context.Context, res gjso } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityIdentityEntries, 0) + data.Entries = make([]PolicyObjectSecurityIdentityListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityIdentityEntries{} + item := PolicyObjectSecurityIdentityListEntries{} item.User = types.StringNull() if t := v.Get("user.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectSecurityIdentity) fromBody(ctx context.Context, res gjso // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityIdentity) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityIdentityList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectSecurityIdentity) updateFromBody(ctx context.Context, re // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityIdentity) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityIdentityList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_ips_signature_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_ips_signature_profile_parcel.go index fb7228b8d..979af2783 100644 --- a/internal/provider/model_sdwan_policy_object_security_ips_signature_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_ips_signature_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityIPsSignature struct { +type PolicyObjectSecurityIPSSignature struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityIPsSignatureEntries `tfsdk:"entries"` + Entries []PolicyObjectSecurityIPSSignatureEntries `tfsdk:"entries"` } -type PolicyObjectSecurityIPsSignatureEntries struct { +type PolicyObjectSecurityIPSSignatureEntries struct { GeneratorId types.String `tfsdk:"generator_id"` SignatureId types.String `tfsdk:"signature_id"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityIPsSignatureEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityIPsSignature) getModel() string { +func (data PolicyObjectSecurityIPSSignature) getModel() string { return "policy_object_security_ips_signature" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityIPsSignature) getPath() string { +func (data PolicyObjectSecurityIPSSignature) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-ipssignature", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityIPsSignature) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityIPSSignature) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityIPsSignature) toBody(ctx context.Context) string // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityIPsSignature) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityIPSSignature) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityIPsSignature) fromBody(ctx context.Context, res } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityIPsSignatureEntries, 0) + data.Entries = make([]PolicyObjectSecurityIPSSignatureEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityIPsSignatureEntries{} + item := PolicyObjectSecurityIPSSignatureEntries{} item.GeneratorId = types.StringNull() if t := v.Get("generatorId.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectSecurityIPsSignature) fromBody(ctx context.Context, res // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityIPsSignature) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityIPSSignature) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectSecurityIPsSignature) updateFromBody(ctx context.Context // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityIPsSignature) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityIPSSignature) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_localapp_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_local_application_list_profile_parcel.go similarity index 79% rename from internal/provider/model_sdwan_policy_object_security_localapp_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_local_application_list_profile_parcel.go index 1981cad13..5696df6fb 100644 --- a/internal/provider/model_sdwan_policy_object_security_localapp_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_local_application_list_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityLocalapp struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityLocalappEntries `tfsdk:"entries"` +type PolicyObjectSecurityLocalApplicationList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityLocalApplicationListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityLocalappEntries struct { +type PolicyObjectSecurityLocalApplicationListEntries struct { App types.String `tfsdk:"app"` AppFamily types.String `tfsdk:"app_family"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityLocalappEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityLocalapp) getModel() string { - return "policy_object_security_localapp" +func (data PolicyObjectSecurityLocalApplicationList) getModel() string { + return "policy_object_security_local_application_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityLocalapp) getPath() string { +func (data PolicyObjectSecurityLocalApplicationList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-localapp", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityLocalapp) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityLocalApplicationList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityLocalapp) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityLocalapp) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityLocalApplicationList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityLocalapp) fromBody(ctx context.Context, res gjso } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityLocalappEntries, 0) + data.Entries = make([]PolicyObjectSecurityLocalApplicationListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityLocalappEntries{} + item := PolicyObjectSecurityLocalApplicationListEntries{} item.App = types.StringNull() if t := v.Get("app.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectSecurityLocalapp) fromBody(ctx context.Context, res gjso // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityLocalapp) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityLocalApplicationList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectSecurityLocalapp) updateFromBody(ctx context.Context, re // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityLocalapp) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityLocalApplicationList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_localdomain_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_local_domain_list_profile_parcel.go similarity index 71% rename from internal/provider/model_sdwan_policy_object_security_localdomain_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_local_domain_list_profile_parcel.go index af6c36a3b..a0fd93d91 100644 --- a/internal/provider/model_sdwan_policy_object_security_localdomain_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_local_domain_list_profile_parcel.go @@ -31,37 +31,37 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityLocaldomain struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityLocaldomainEntries `tfsdk:"entries"` +type PolicyObjectSecurityLocalDomainList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityLocalDomainListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityLocaldomainEntries struct { - NameServer types.String `tfsdk:"name_server"` +type PolicyObjectSecurityLocalDomainListEntries struct { + LocalDomain types.String `tfsdk:"local_domain"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityLocaldomain) getModel() string { - return "policy_object_security_localdomain" +func (data PolicyObjectSecurityLocalDomainList) getModel() string { + return "policy_object_security_local_domain_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityLocaldomain) getPath() string { +func (data PolicyObjectSecurityLocalDomainList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-localdomain", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityLocaldomain) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityLocalDomainList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -70,10 +70,10 @@ func (data PolicyObjectSecurityLocaldomain) toBody(ctx context.Context) string { for _, item := range data.Entries { itemBody := "" - if !item.NameServer.IsNull() { + if !item.LocalDomain.IsNull() { if true { itemBody, _ = sjson.Set(itemBody, "nameServer.optionType", "global") - itemBody, _ = sjson.Set(itemBody, "nameServer.value", item.NameServer.ValueString()) + itemBody, _ = sjson.Set(itemBody, "nameServer.value", item.LocalDomain.ValueString()) } } body, _ = sjson.SetRaw(body, path+"entries.-1", itemBody) @@ -85,7 +85,7 @@ func (data PolicyObjectSecurityLocaldomain) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityLocaldomain) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityLocalDomainList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -94,15 +94,15 @@ func (data *PolicyObjectSecurityLocaldomain) fromBody(ctx context.Context, res g } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityLocaldomainEntries, 0) + data.Entries = make([]PolicyObjectSecurityLocalDomainListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityLocaldomainEntries{} - item.NameServer = types.StringNull() + item := PolicyObjectSecurityLocalDomainListEntries{} + item.LocalDomain = types.StringNull() if t := v.Get("nameServer.optionType"); t.Exists() { va := v.Get("nameServer.value") if t.String() == "global" { - item.NameServer = types.StringValue(va.String()) + item.LocalDomain = types.StringValue(va.String()) } } data.Entries = append(data.Entries, item) @@ -114,7 +114,7 @@ func (data *PolicyObjectSecurityLocaldomain) fromBody(ctx context.Context, res g // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityLocaldomain) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityLocalDomainList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -124,7 +124,7 @@ func (data *PolicyObjectSecurityLocaldomain) updateFromBody(ctx context.Context, path := "payload.data." for i := range data.Entries { keys := [...]string{"nameServer"} - keyValues := [...]string{data.Entries[i].NameServer.ValueString()} + keyValues := [...]string{data.Entries[i].LocalDomain.ValueString()} keyValuesVariables := [...]string{""} var r gjson.Result @@ -151,12 +151,12 @@ func (data *PolicyObjectSecurityLocaldomain) updateFromBody(ctx context.Context, return true }, ) - data.Entries[i].NameServer = types.StringNull() + data.Entries[i].LocalDomain = types.StringNull() if t := r.Get("nameServer.optionType"); t.Exists() { va := r.Get("nameServer.value") if t.String() == "global" { - data.Entries[i].NameServer = types.StringValue(va.String()) + data.Entries[i].LocalDomain = types.StringValue(va.String()) } } } @@ -165,7 +165,7 @@ func (data *PolicyObjectSecurityLocaldomain) updateFromBody(ctx context.Context, // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityLocaldomain) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityLocalDomainList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_port_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_port_list_profile_parcel.go similarity index 79% rename from internal/provider/model_sdwan_policy_object_security_port_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_port_list_profile_parcel.go index 9b4794d3a..d63a92a47 100644 --- a/internal/provider/model_sdwan_policy_object_security_port_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_port_list_profile_parcel.go @@ -31,37 +31,37 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityPort struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityPortEntries `tfsdk:"entries"` +type PolicyObjectSecurityPortList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityPortListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityPortEntries struct { +type PolicyObjectSecurityPortListEntries struct { Port types.String `tfsdk:"port"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityPort) getModel() string { - return "policy_object_security_port" +func (data PolicyObjectSecurityPortList) getModel() string { + return "policy_object_security_port_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityPort) getPath() string { +func (data PolicyObjectSecurityPortList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-port", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityPort) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityPortList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -85,7 +85,7 @@ func (data PolicyObjectSecurityPort) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityPort) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityPortList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -94,9 +94,9 @@ func (data *PolicyObjectSecurityPort) fromBody(ctx context.Context, res gjson.Re } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityPortEntries, 0) + data.Entries = make([]PolicyObjectSecurityPortListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityPortEntries{} + item := PolicyObjectSecurityPortListEntries{} item.Port = types.StringNull() if t := v.Get("port.optionType"); t.Exists() { @@ -114,7 +114,7 @@ func (data *PolicyObjectSecurityPort) fromBody(ctx context.Context, res gjson.Re // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityPort) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityPortList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -165,7 +165,7 @@ func (data *PolicyObjectSecurityPort) updateFromBody(ctx context.Context, res gj // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityPort) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityPortList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go similarity index 84% rename from internal/provider/model_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go index 92f279fd7..6aecc5bd3 100644 --- a/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go @@ -31,16 +31,16 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityScalableGroupTag struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityScalableGroupTagEntries `tfsdk:"entries"` +type PolicyObjectSecurityScalableGroupTagList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectSecurityScalableGroupTagListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityScalableGroupTagEntries struct { +type PolicyObjectSecurityScalableGroupTagListEntries struct { SgtName types.String `tfsdk:"sgt_name"` Tag types.String `tfsdk:"tag"` } @@ -48,21 +48,21 @@ type PolicyObjectSecurityScalableGroupTagEntries struct { // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityScalableGroupTag) getModel() string { - return "policy_object_security_scalable_group_tag" +func (data PolicyObjectSecurityScalableGroupTagList) getModel() string { + return "policy_object_security_scalable_group_tag_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityScalableGroupTag) getPath() string { +func (data PolicyObjectSecurityScalableGroupTagList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-scalablegrouptag", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityScalableGroupTag) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityScalableGroupTagList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -92,7 +92,7 @@ func (data PolicyObjectSecurityScalableGroupTag) toBody(ctx context.Context) str // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityScalableGroupTag) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityScalableGroupTagList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -101,9 +101,9 @@ func (data *PolicyObjectSecurityScalableGroupTag) fromBody(ctx context.Context, } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityScalableGroupTagEntries, 0) + data.Entries = make([]PolicyObjectSecurityScalableGroupTagListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityScalableGroupTagEntries{} + item := PolicyObjectSecurityScalableGroupTagListEntries{} item.SgtName = types.StringNull() if t := v.Get("sgtName.optionType"); t.Exists() { @@ -129,7 +129,7 @@ func (data *PolicyObjectSecurityScalableGroupTag) fromBody(ctx context.Context, // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityScalableGroupTag) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityScalableGroupTagList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -188,7 +188,7 @@ func (data *PolicyObjectSecurityScalableGroupTag) updateFromBody(ctx context.Con // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityScalableGroupTag) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityScalableGroupTagList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_security_urllist_profile_parcel.go b/internal/provider/model_sdwan_policy_object_security_url_list_profile_parcel.go similarity index 88% rename from internal/provider/model_sdwan_policy_object_security_urllist_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_security_url_list_profile_parcel.go index 2e07fe574..fbeec73d3 100644 --- a/internal/provider/model_sdwan_policy_object_security_urllist_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_security_url_list_profile_parcel.go @@ -31,37 +31,37 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectSecurityURLlist struct { +type PolicyObjectSecurityURLList struct { Id types.String `tfsdk:"id"` Version types.Int64 `tfsdk:"version"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectSecurityURLlistEntries `tfsdk:"entries"` + Entries []PolicyObjectSecurityURLListEntries `tfsdk:"entries"` } -type PolicyObjectSecurityURLlistEntries struct { +type PolicyObjectSecurityURLListEntries struct { Pattern types.String `tfsdk:"pattern"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectSecurityURLlist) getModel() string { - return "policy_object_security_urllist" +func (data PolicyObjectSecurityURLList) getModel() string { + return "policy_object_security_url_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectSecurityURLlist) getPath() string { +func (data PolicyObjectSecurityURLList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/security-urllist", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectSecurityURLlist) toBody(ctx context.Context) string { +func (data PolicyObjectSecurityURLList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -85,7 +85,7 @@ func (data PolicyObjectSecurityURLlist) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectSecurityURLlist) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityURLList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -94,9 +94,9 @@ func (data *PolicyObjectSecurityURLlist) fromBody(ctx context.Context, res gjson } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectSecurityURLlistEntries, 0) + data.Entries = make([]PolicyObjectSecurityURLListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectSecurityURLlistEntries{} + item := PolicyObjectSecurityURLListEntries{} item.Pattern = types.StringNull() if t := v.Get("pattern.optionType"); t.Exists() { @@ -114,7 +114,7 @@ func (data *PolicyObjectSecurityURLlist) fromBody(ctx context.Context, res gjson // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectSecurityURLlist) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectSecurityURLList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -165,7 +165,7 @@ func (data *PolicyObjectSecurityURLlist) updateFromBody(ctx context.Context, res // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectSecurityURLlist) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectSecurityURLList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/model_sdwan_policy_object_standard_community_profile_parcel.go b/internal/provider/model_sdwan_policy_object_standard_community_list_profile_parcel.go similarity index 79% rename from internal/provider/model_sdwan_policy_object_standard_community_profile_parcel.go rename to internal/provider/model_sdwan_policy_object_standard_community_list_profile_parcel.go index 37e2793f4..c80a5eaae 100644 --- a/internal/provider/model_sdwan_policy_object_standard_community_profile_parcel.go +++ b/internal/provider/model_sdwan_policy_object_standard_community_list_profile_parcel.go @@ -31,37 +31,37 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin types -type PolicyObjectStandardCommunity struct { - Id types.String `tfsdk:"id"` - Version types.Int64 `tfsdk:"version"` - Name types.String `tfsdk:"name"` - Description types.String `tfsdk:"description"` - FeatureProfileId types.String `tfsdk:"feature_profile_id"` - Entries []PolicyObjectStandardCommunityEntries `tfsdk:"entries"` +type PolicyObjectStandardCommunityList struct { + Id types.String `tfsdk:"id"` + Version types.Int64 `tfsdk:"version"` + Name types.String `tfsdk:"name"` + Description types.String `tfsdk:"description"` + FeatureProfileId types.String `tfsdk:"feature_profile_id"` + Entries []PolicyObjectStandardCommunityListEntries `tfsdk:"entries"` } -type PolicyObjectStandardCommunityEntries struct { +type PolicyObjectStandardCommunityListEntries struct { StandardCommunity types.String `tfsdk:"standard_community"` } // End of section. //template:end types // Section below is generated&owned by "gen/generator.go". //template:begin getModel -func (data PolicyObjectStandardCommunity) getModel() string { - return "policy_object_standard_community" +func (data PolicyObjectStandardCommunityList) getModel() string { + return "policy_object_standard_community_list" } // End of section. //template:end getModel // Section below is generated&owned by "gen/generator.go". //template:begin getPath -func (data PolicyObjectStandardCommunity) getPath() string { +func (data PolicyObjectStandardCommunityList) getPath() string { return fmt.Sprintf("/v1/feature-profile/sdwan/policy-object/%v/standard-community", url.QueryEscape(data.FeatureProfileId.ValueString())) } // End of section. //template:end getPath // Section below is generated&owned by "gen/generator.go". //template:begin toBody -func (data PolicyObjectStandardCommunity) toBody(ctx context.Context) string { +func (data PolicyObjectStandardCommunityList) toBody(ctx context.Context) string { body := "" body, _ = sjson.Set(body, "name", data.Name.ValueString()) body, _ = sjson.Set(body, "description", data.Description.ValueString()) @@ -85,7 +85,7 @@ func (data PolicyObjectStandardCommunity) toBody(ctx context.Context) string { // End of section. //template:end toBody // Section below is generated&owned by "gen/generator.go". //template:begin fromBody -func (data *PolicyObjectStandardCommunity) fromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectStandardCommunityList) fromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -94,9 +94,9 @@ func (data *PolicyObjectStandardCommunity) fromBody(ctx context.Context, res gjs } path := "payload.data." if value := res.Get(path + "entries"); value.Exists() { - data.Entries = make([]PolicyObjectStandardCommunityEntries, 0) + data.Entries = make([]PolicyObjectStandardCommunityListEntries, 0) value.ForEach(func(k, v gjson.Result) bool { - item := PolicyObjectStandardCommunityEntries{} + item := PolicyObjectStandardCommunityListEntries{} item.StandardCommunity = types.StringNull() if t := v.Get("standardCommunity.optionType"); t.Exists() { @@ -114,7 +114,7 @@ func (data *PolicyObjectStandardCommunity) fromBody(ctx context.Context, res gjs // End of section. //template:end fromBody // Section below is generated&owned by "gen/generator.go". //template:begin updateFromBody -func (data *PolicyObjectStandardCommunity) updateFromBody(ctx context.Context, res gjson.Result) { +func (data *PolicyObjectStandardCommunityList) updateFromBody(ctx context.Context, res gjson.Result) { data.Name = types.StringValue(res.Get("payload.name").String()) if value := res.Get("payload.description"); value.Exists() && value.String() != "" { data.Description = types.StringValue(value.String()) @@ -165,7 +165,7 @@ func (data *PolicyObjectStandardCommunity) updateFromBody(ctx context.Context, r // End of section. //template:end updateFromBody // Section below is generated&owned by "gen/generator.go". //template:begin isNull -func (data *PolicyObjectStandardCommunity) isNull(ctx context.Context, res gjson.Result) bool { +func (data *PolicyObjectStandardCommunityList) isNull(ctx context.Context, res gjson.Result) bool { if !data.FeatureProfileId.IsNull() { return false } diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 206f5487e..e345a9c01 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -285,8 +285,8 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc NewApplicationPriorityQoSPolicyProfileParcelResource, NewOtherThousandEyesProfileParcelResource, NewOtherUCSEProfileParcelResource, - NewPolicyObjectAppProbeProfileParcelResource, - NewPolicyObjectASPathProfileParcelResource, + NewPolicyObjectAppProbeClassProfileParcelResource, + NewPolicyObjectASPathListProfileParcelResource, NewPolicyObjectClassMapProfileParcelResource, NewPolicyObjectColorListProfileParcelResource, NewPolicyObjectDataIPv4PrefixListProfileParcelResource, @@ -298,17 +298,17 @@ func (p *SdwanProvider) Resources(ctx context.Context) []func() resource.Resourc NewPolicyObjectMirrorProfileParcelResource, NewPolicyObjectPolicerProfileParcelResource, NewPolicyObjectPreferredColorGroupProfileParcelResource, - NewPolicyObjectSecurityDataIPPrefixProfileParcelResource, - NewPolicyObjectSecurityFQDNProfileParcelResource, - NewPolicyObjectSecurityGeolocationProfileParcelResource, - NewPolicyObjectSecurityIdentityProfileParcelResource, - NewPolicyObjectSecurityIPsSignatureProfileParcelResource, - NewPolicyObjectSecurityLocalappProfileParcelResource, - NewPolicyObjectSecurityLocaldomainProfileParcelResource, - NewPolicyObjectSecurityPortProfileParcelResource, - NewPolicyObjectSecurityScalableGroupTagProfileParcelResource, - NewPolicyObjectSecurityURLlistProfileParcelResource, - NewPolicyObjectStandardCommunityProfileParcelResource, + NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelResource, + NewPolicyObjectSecurityFQDNListProfileParcelResource, + NewPolicyObjectSecurityGeolocationListProfileParcelResource, + NewPolicyObjectSecurityIdentityListProfileParcelResource, + NewPolicyObjectSecurityIPSSignatureProfileParcelResource, + NewPolicyObjectSecurityLocalApplicationListProfileParcelResource, + NewPolicyObjectSecurityLocalDomainListProfileParcelResource, + NewPolicyObjectSecurityPortListProfileParcelResource, + NewPolicyObjectSecurityScalableGroupTagListProfileParcelResource, + NewPolicyObjectSecurityURLListProfileParcelResource, + NewPolicyObjectStandardCommunityListProfileParcelResource, NewPolicyObjectTLOCListProfileParcelResource, NewPolicyObjectVPNGroupProfileParcelResource, NewServiceLANVPNProfileParcelResource, @@ -480,8 +480,8 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat NewApplicationPriorityQoSPolicyProfileParcelDataSource, NewOtherThousandEyesProfileParcelDataSource, NewOtherUCSEProfileParcelDataSource, - NewPolicyObjectAppProbeProfileParcelDataSource, - NewPolicyObjectASPathProfileParcelDataSource, + NewPolicyObjectAppProbeClassProfileParcelDataSource, + NewPolicyObjectASPathListProfileParcelDataSource, NewPolicyObjectClassMapProfileParcelDataSource, NewPolicyObjectColorListProfileParcelDataSource, NewPolicyObjectDataIPv4PrefixListProfileParcelDataSource, @@ -493,17 +493,17 @@ func (p *SdwanProvider) DataSources(ctx context.Context) []func() datasource.Dat NewPolicyObjectMirrorProfileParcelDataSource, NewPolicyObjectPolicerProfileParcelDataSource, NewPolicyObjectPreferredColorGroupProfileParcelDataSource, - NewPolicyObjectSecurityDataIPPrefixProfileParcelDataSource, - NewPolicyObjectSecurityFQDNProfileParcelDataSource, - NewPolicyObjectSecurityGeolocationProfileParcelDataSource, - NewPolicyObjectSecurityIdentityProfileParcelDataSource, - NewPolicyObjectSecurityIPsSignatureProfileParcelDataSource, - NewPolicyObjectSecurityLocalappProfileParcelDataSource, - NewPolicyObjectSecurityLocaldomainProfileParcelDataSource, - NewPolicyObjectSecurityPortProfileParcelDataSource, - NewPolicyObjectSecurityScalableGroupTagProfileParcelDataSource, - NewPolicyObjectSecurityURLlistProfileParcelDataSource, - NewPolicyObjectStandardCommunityProfileParcelDataSource, + NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelDataSource, + NewPolicyObjectSecurityFQDNListProfileParcelDataSource, + NewPolicyObjectSecurityGeolocationListProfileParcelDataSource, + NewPolicyObjectSecurityIdentityListProfileParcelDataSource, + NewPolicyObjectSecurityIPSSignatureProfileParcelDataSource, + NewPolicyObjectSecurityLocalApplicationListProfileParcelDataSource, + NewPolicyObjectSecurityLocalDomainListProfileParcelDataSource, + NewPolicyObjectSecurityPortListProfileParcelDataSource, + NewPolicyObjectSecurityScalableGroupTagListProfileParcelDataSource, + NewPolicyObjectSecurityURLListProfileParcelDataSource, + NewPolicyObjectStandardCommunityListProfileParcelDataSource, NewPolicyObjectTLOCListProfileParcelDataSource, NewPolicyObjectVPNGroupProfileParcelDataSource, NewServiceLANVPNProfileParcelDataSource, diff --git a/internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel.go similarity index 82% rename from internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel.go index 1ca0129ec..b0be775e1 100644 --- a/internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectAppProbeProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectAppProbeProfileParcelResource{} +var _ resource.Resource = &PolicyObjectAppProbeClassProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectAppProbeClassProfileParcelResource{} -func NewPolicyObjectAppProbeProfileParcelResource() resource.Resource { - return &PolicyObjectAppProbeProfileParcelResource{} +func NewPolicyObjectAppProbeClassProfileParcelResource() resource.Resource { + return &PolicyObjectAppProbeClassProfileParcelResource{} } -type PolicyObjectAppProbeProfileParcelResource struct { +type PolicyObjectAppProbeClassProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectAppProbeProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_profile_parcel" +func (r *PolicyObjectAppProbeClassProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_app_probe_class_profile_parcel" } -func (r *PolicyObjectAppProbeProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectAppProbeClassProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object App Probe profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object App Probe Class profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -126,7 +126,7 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Schema(ctx context.Context, } } -func (r *PolicyObjectAppProbeProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectAppProbeClassProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -138,8 +138,8 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Configure(_ context.Context, // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectAppProbeProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectAppProbe +func (r *PolicyObjectAppProbeClassProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectAppProbeClass // Read plan diags := req.Plan.Get(ctx, &plan) @@ -171,8 +171,8 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Create(ctx context.Context, // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectAppProbeProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectAppProbe +func (r *PolicyObjectAppProbeClassProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectAppProbeClass // Read state diags := req.State.Get(ctx, &state) @@ -208,8 +208,8 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Read(ctx context.Context, re // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectAppProbeProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectAppProbe +func (r *PolicyObjectAppProbeClassProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectAppProbeClass // Read plan diags := req.Plan.Get(ctx, &plan) @@ -244,8 +244,8 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Update(ctx context.Context, // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectAppProbeProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectAppProbe +func (r *PolicyObjectAppProbeClassProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectAppProbeClass // Read state diags := req.State.Get(ctx, &state) @@ -270,7 +270,7 @@ func (r *PolicyObjectAppProbeProfileParcelResource) Delete(ctx context.Context, // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectAppProbeProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectAppProbeClassProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel_test.go similarity index 78% rename from internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel_test.go index d9ede5ef6..7aaf83273 100644 --- a/internal/provider/resource_sdwan_policy_object_app_probe_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_app_probe_class_profile_parcel_test.go @@ -28,21 +28,21 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectAppProbeProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectAppProbeClassProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.map.0.color", "3g")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.map.0.dscp", "45")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_profile_parcel.test", "entries.0.forwarding_class", "classlist1")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.map.0.color", "3g")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.map.0.dscp", "45")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_app_probe_class_profile_parcel.test", "entries.0.forwarding_class", "classlist1")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectAppProbePrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectAppProbeProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectAppProbeClassProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -52,7 +52,7 @@ func TestAccSdwanPolicyObjectAppProbeProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectAppProbePrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectAppProbeClassPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -63,8 +63,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectAppProbeProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_app_probe_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectAppProbeClassProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_app_probe_class_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_as_path_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel.go similarity index 81% rename from internal/provider/resource_sdwan_policy_object_as_path_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel.go index 5b35e80a9..2b09f61a3 100644 --- a/internal/provider/resource_sdwan_policy_object_as_path_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel.go @@ -44,26 +44,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectASPathProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectASPathProfileParcelResource{} +var _ resource.Resource = &PolicyObjectASPathListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectASPathListProfileParcelResource{} -func NewPolicyObjectASPathProfileParcelResource() resource.Resource { - return &PolicyObjectASPathProfileParcelResource{} +func NewPolicyObjectASPathListProfileParcelResource() resource.Resource { + return &PolicyObjectASPathListProfileParcelResource{} } -type PolicyObjectASPathProfileParcelResource struct { +type PolicyObjectASPathListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectASPathProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_profile_parcel" +func (r *PolicyObjectASPathListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_as_path_list_profile_parcel" } -func (r *PolicyObjectASPathProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectASPathListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object AS Path profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object AS Path List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -115,7 +115,7 @@ func (r *PolicyObjectASPathProfileParcelResource) Schema(ctx context.Context, re } } -func (r *PolicyObjectASPathProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectASPathListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -127,8 +127,8 @@ func (r *PolicyObjectASPathProfileParcelResource) Configure(_ context.Context, r // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectASPathProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectASPath +func (r *PolicyObjectASPathListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectASPathList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -160,8 +160,8 @@ func (r *PolicyObjectASPathProfileParcelResource) Create(ctx context.Context, re // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectASPathProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectASPath +func (r *PolicyObjectASPathListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectASPathList // Read state diags := req.State.Get(ctx, &state) @@ -197,8 +197,8 @@ func (r *PolicyObjectASPathProfileParcelResource) Read(ctx context.Context, req // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectASPathProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectASPath +func (r *PolicyObjectASPathListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectASPathList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -233,8 +233,8 @@ func (r *PolicyObjectASPathProfileParcelResource) Update(ctx context.Context, re // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectASPathProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectASPath +func (r *PolicyObjectASPathListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectASPathList // Read state diags := req.State.Get(ctx, &state) @@ -259,7 +259,7 @@ func (r *PolicyObjectASPathProfileParcelResource) Delete(ctx context.Context, re // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectASPathProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectASPathListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_as_path_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel_test.go similarity index 80% rename from internal/provider/resource_sdwan_policy_object_as_path_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel_test.go index 2166f0543..0e3193ec9 100644 --- a/internal/provider/resource_sdwan_policy_object_as_path_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_as_path_list_profile_parcel_test.go @@ -28,20 +28,20 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectASPathProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectASPathListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_profile_parcel.test", "as_path_list_id", "1")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_profile_parcel.test", "entries.0.as_path_list", "110")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_list_profile_parcel.test", "as_path_list_id", "1")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_as_path_list_profile_parcel.test", "entries.0.as_path_list", "110")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectASPathPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectASPathProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectASPathListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -51,7 +51,7 @@ func TestAccSdwanPolicyObjectASPathProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectASPathPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectASPathListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -62,8 +62,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectASPathProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_as_path_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectASPathListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_as_path_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go new file mode 100644 index 000000000..038093fdf --- /dev/null +++ b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.go @@ -0,0 +1,262 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "context" + "fmt" + "net/url" + "regexp" + "sync" + + "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/netascode/go-sdwan" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin model + +// Ensure provider defined types fully satisfy framework interfaces +var _ resource.Resource = &PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource{} + +func NewPolicyObjectSecurityDataIPv4PrefixListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource{} +} + +type PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource struct { + client *sdwan.Client + updateMutex *sync.Mutex +} + +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_data_ipv4_prefix_list_profile_parcel" +} + +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + // This description is used by the documentation generator and the language server. + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Data IPv4 Prefix List profile parcel.").AddMinimumVersionDescription("20.12.0").String, + + Attributes: map[string]schema.Attribute{ + "id": schema.StringAttribute{ + MarkdownDescription: "The id of the profile parcel", + Computed: true, + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "version": schema.Int64Attribute{ + MarkdownDescription: "The version of the profile parcel", + Computed: true, + }, + "name": schema.StringAttribute{ + MarkdownDescription: "The name of the profile parcel", + Required: true, + }, + "description": schema.StringAttribute{ + MarkdownDescription: "The description of the profile parcel", + Optional: true, + }, + "feature_profile_id": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String, + Required: true, + }, + "entries": schema.ListNestedAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Required: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "ip_prefix": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + Validators: []validator.String{ + stringvalidator.RegexMatches(regexp.MustCompile(`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/)([0-2]?[0-9]$|[3]?[0-2])`), ""), + }, + }, + "ip_prefix_variable": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, + Optional: true, + }, + }, + }, + }, + }, + } +} + +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { + if req.ProviderData == nil { + return + } + + r.client = req.ProviderData.(*SdwanProviderData).Client + r.updateMutex = req.ProviderData.(*SdwanProviderData).UpdateMutex +} + +// End of section. //template:end model + +// Section below is generated&owned by "gen/generator.go". //template:begin create +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityDataIPv4PrefixList + + // Read plan + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.Name.ValueString())) + + // Create object + body := plan.toBody(ctx) + + res, err := r.client.Post(plan.getPath(), body) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (POST), got error: %s, %s", err, res.String())) + return + } + + plan.Id = types.StringValue(res.Get("parcelId").String()) + plan.Version = types.Int64Value(0) + + tflog.Debug(ctx, fmt.Sprintf("%s: Create finished successfully", plan.Name.ValueString())) + + diags = resp.State.Set(ctx, &plan) + resp.Diagnostics.Append(diags...) +} + +// End of section. //template:end create + +// Section below is generated&owned by "gen/generator.go". //template:begin read +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityDataIPv4PrefixList + + // Read state + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String())) + + res, err := r.client.Get(state.getPath() + "/" + url.QueryEscape(state.Id.ValueString())) + if res.Get("error.message").String() == "Invalid feature Id" { + resp.State.RemoveResource(ctx) + return + } else if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object (GET), got error: %s, %s", err, res.String())) + return + } + + // 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) + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) + + diags = resp.State.Set(ctx, &state) + resp.Diagnostics.Append(diags...) +} + +// End of section. //template:end read + +// Section below is generated&owned by "gen/generator.go". //template:begin update +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityDataIPv4PrefixList + + // Read plan + diags := req.Plan.Get(ctx, &plan) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + // Read state + diags = req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.Name.ValueString())) + + body := plan.toBody(ctx) + res, err := r.client.Put(plan.getPath()+"/"+url.QueryEscape(plan.Id.ValueString()), body) + if err != nil { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String())) + return + } + + plan.Version = types.Int64Value(state.Version.ValueInt64() + 1) + + tflog.Debug(ctx, fmt.Sprintf("%s: Update finished successfully", plan.Name.ValueString())) + + diags = resp.State.Set(ctx, &plan) + resp.Diagnostics.Append(diags...) +} + +// End of section. //template:end update + +// Section below is generated&owned by "gen/generator.go". //template:begin delete +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityDataIPv4PrefixList + + // Read state + diags := req.State.Get(ctx, &state) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Name.ValueString())) + + res, err := r.client.Delete(state.getPath() + "/" + url.QueryEscape(state.Id.ValueString())) + if err != nil && res.Get("error.message").String() != "Invalid Template Id" { + resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (DELETE), got error: %s, %s", err, res.String())) + return + } + + tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Name.ValueString())) + + resp.State.RemoveResource(ctx) +} + +// End of section. //template:end delete + +// Section below is generated&owned by "gen/generator.go". //template:begin import +func (r *PolicyObjectSecurityDataIPv4PrefixListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// End of section. //template:end import diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go new file mode 100644 index 000000000..0d65cbab5 --- /dev/null +++ b/internal/provider/resource_sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel_test.go @@ -0,0 +1,76 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin testAcc +func TestAccSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcel(t *testing.T) { + if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { + t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") + } + var checks []resource.TestCheckFunc + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel.test", "entries.0.ip_prefix", "10.0.0.0/12")) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + + { + Config: testAccSdwanPolicyObjectSecurityDataIPv4PrefixListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcelConfig_all(), + Check: resource.ComposeTestCheckFunc(checks...), + }, + }, + }) +} + +// End of section. //template:end testAcc + +// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccSdwanPolicyObjectSecurityDataIPv4PrefixListPrerequisitesProfileParcelConfig = ` +variable "policy_object_feature_template_id" {} +` + +// End of section. //template:end testPrerequisites + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum + +// End of section. //template:end testAccConfigMinimum + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll +func testAccSdwanPolicyObjectSecurityDataIPv4PrefixListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel" "test" {` + "\n" + config += ` name = "TF_TEST_ALL"` + "\n" + config += ` description = "Terraform integration test"` + "\n" + config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" + config += ` entries = [{` + "\n" + config += ` ip_prefix = "10.0.0.0/12"` + "\n" + config += ` }]` + "\n" + config += `}` + "\n" + return config +} + +// End of section. //template:end testAccConfigAll diff --git a/internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel.go similarity index 81% rename from internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel.go index 4931f9557..a5e0b4969 100644 --- a/internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityIdentityProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityIdentityProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityFQDNListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityFQDNListProfileParcelResource{} -func NewPolicyObjectSecurityIdentityProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityIdentityProfileParcelResource{} +func NewPolicyObjectSecurityFQDNListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityFQDNListProfileParcelResource{} } -type PolicyObjectSecurityIdentityProfileParcelResource struct { +type PolicyObjectSecurityFQDNListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_profile_parcel" +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_list_profile_parcel" } -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Identity profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security FQDN List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -89,24 +89,16 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Schema(ctx context.C Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Array of Users and User Groups").String, - Optional: true, + MarkdownDescription: helpers.NewAttributeDescription("").String, + Required: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "user": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Optional: true, - Validators: []validator.String{ - stringvalidator.LengthBetween(1, 64), - stringvalidator.RegexMatches(regexp.MustCompile(`^.*[a-zA-Z0-9]+.*$`), ""), - }, - }, - "user_group": schema.StringAttribute{ + "pattern": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("").String, Optional: true, Validators: []validator.String{ - stringvalidator.LengthBetween(1, 96), - stringvalidator.RegexMatches(regexp.MustCompile(`^.*[a-zA-Z0-9]+.*$`), ""), + stringvalidator.LengthBetween(1, 120), + stringvalidator.RegexMatches(regexp.MustCompile(`^([*][.])?(([a-zA-Z0-9-]+.)+)?([a-zA-Z0-9-])+$`), ""), }, }, }, @@ -116,7 +108,7 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Schema(ctx context.C } } -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -128,8 +120,8 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Configure(_ context. // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityIdentity +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityFQDNList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -161,8 +153,8 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Create(ctx context.C // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityIdentity +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityFQDNList // Read state diags := req.State.Get(ctx, &state) @@ -198,8 +190,8 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Read(ctx context.Con // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityIdentity +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityFQDNList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -234,8 +226,8 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Update(ctx context.C // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityIdentityProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityIdentity +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityFQDNList // Read state diags := req.State.Get(ctx, &state) @@ -260,7 +252,7 @@ func (r *PolicyObjectSecurityIdentityProfileParcelResource) Delete(ctx context.C // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityIdentityProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityFQDNListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go similarity index 81% rename from internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go index 336590f34..c58e02d1e 100644 --- a/internal/provider/resource_sdwan_policy_object_security_identity_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_fqdn_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityIdentityProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityFQDNListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_identity_profile_parcel.test", "entries.0.user", "administrator")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_fqdn_list_profile_parcel.test", "entries.0.pattern", "cisco.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityIdentityPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIdentityProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityFQDNListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityIdentityProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityIdentityPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityFQDNListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,13 +61,13 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityIdentityProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_identity_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityFQDNListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_fqdn_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` user = "administrator"` + "\n" + config += ` pattern = "cisco.com"` + "\n" config += ` }]` + "\n" config += `}` + "\n" return config diff --git a/internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel.go similarity index 85% rename from internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel.go index 5c668b133..6f14c5bfa 100644 --- a/internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel.go @@ -42,26 +42,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityGeolocationProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityGeolocationProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityGeolocationListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityGeolocationListProfileParcelResource{} -func NewPolicyObjectSecurityGeolocationProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityGeolocationProfileParcelResource{} +func NewPolicyObjectSecurityGeolocationListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityGeolocationListProfileParcelResource{} } -type PolicyObjectSecurityGeolocationProfileParcelResource struct { +type PolicyObjectSecurityGeolocationListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_profile_parcel" +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_geolocation_list_profile_parcel" } -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Geolocation profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Geolocation List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -113,7 +113,7 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Schema(ctx contex } } -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -125,8 +125,8 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Configure(_ conte // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityGeolocation +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityGeolocationList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -158,8 +158,8 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Create(ctx contex // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityGeolocation +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityGeolocationList // Read state diags := req.State.Get(ctx, &state) @@ -195,8 +195,8 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Read(ctx context. // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityGeolocation +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityGeolocationList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -231,8 +231,8 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Update(ctx contex // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityGeolocation +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityGeolocationList // Read state diags := req.State.Get(ctx, &state) @@ -257,7 +257,7 @@ func (r *PolicyObjectSecurityGeolocationProfileParcelResource) Delete(ctx contex // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityGeolocationProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityGeolocationListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go index e7ff363e5..b25756247 100644 --- a/internal/provider/resource_sdwan_policy_object_security_geolocation_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_geolocation_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityGeolocationProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityGeolocationListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_geolocation_profile_parcel.test", "entries.0.country", "DZA")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_geolocation_list_profile_parcel.test", "entries.0.country", "DZA")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityGeolocationPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityGeolocationProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityGeolocationProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityGeolocationPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityGeolocationListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,8 +61,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityGeolocationProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_geolocation_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityGeolocationListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_geolocation_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel.go similarity index 81% rename from internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel.go index 64775196e..e4846ebf5 100644 --- a/internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityDataIPPrefixProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityDataIPPrefixProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityIdentityListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityIdentityListProfileParcelResource{} -func NewPolicyObjectSecurityDataIPPrefixProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityDataIPPrefixProfileParcelResource{} +func NewPolicyObjectSecurityIdentityListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityIdentityListProfileParcelResource{} } -type PolicyObjectSecurityDataIPPrefixProfileParcelResource struct { +type PolicyObjectSecurityIdentityListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_data_ip_prefix_profile_parcel" +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_identity_list_profile_parcel" } -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Data IP Prefix profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Identity List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -89,20 +89,25 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Schema(ctx conte Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Required: true, + MarkdownDescription: helpers.NewAttributeDescription("Array of Users and User Groups").String, + Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "ip_prefix": schema.StringAttribute{ + "user": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("").String, Optional: true, Validators: []validator.String{ - stringvalidator.RegexMatches(regexp.MustCompile(`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/)([0-2]?[0-9]$|[3]?[0-2])`), ""), + stringvalidator.LengthBetween(1, 64), + stringvalidator.RegexMatches(regexp.MustCompile(`^.*[a-zA-Z0-9]+.*$`), ""), }, }, - "ip_prefix_variable": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Variable name").String, + "user_group": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, Optional: true, + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 96), + stringvalidator.RegexMatches(regexp.MustCompile(`^.*[a-zA-Z0-9]+.*$`), ""), + }, }, }, }, @@ -111,7 +116,7 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Schema(ctx conte } } -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -123,8 +128,8 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Configure(_ cont // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityDataIPPrefix +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityIdentityList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -156,8 +161,8 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Create(ctx conte // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityDataIPPrefix +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityIdentityList // Read state diags := req.State.Get(ctx, &state) @@ -193,8 +198,8 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Read(ctx context // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityDataIPPrefix +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityIdentityList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -229,8 +234,8 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Update(ctx conte // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityDataIPPrefix +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityIdentityList // Read state diags := req.State.Get(ctx, &state) @@ -255,7 +260,7 @@ func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) Delete(ctx conte // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityDataIPPrefixProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityIdentityListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel_test.go similarity index 80% rename from internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel_test.go index 8aaf0a522..21f17d876 100644 --- a/internal/provider/resource_sdwan_policy_object_security_data_ip_prefix_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_identity_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityDataIPPrefixProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityIdentityListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_data_ip_prefix_profile_parcel.test", "entries.0.ip_prefix", "10.0.0.0/12")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_identity_list_profile_parcel.test", "entries.0.user", "administrator")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityDataIPPrefixPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityDataIPPrefixProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIdentityListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityDataIPPrefixProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityDataIPPrefixPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityIdentityListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,13 +61,13 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityDataIPPrefixProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_data_ip_prefix_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityIdentityListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_identity_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` ip_prefix = "10.0.0.0/12"` + "\n" + config += ` user = "administrator"` + "\n" config += ` }]` + "\n" config += `}` + "\n" return config diff --git a/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel.go index ec4594487..36ab440a6 100644 --- a/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityIPsSignatureProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityIPsSignatureProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityIPSSignatureProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityIPSSignatureProfileParcelResource{} -func NewPolicyObjectSecurityIPsSignatureProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityIPsSignatureProfileParcelResource{} +func NewPolicyObjectSecurityIPSSignatureProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityIPSSignatureProfileParcelResource{} } -type PolicyObjectSecurityIPsSignatureProfileParcelResource struct { +type PolicyObjectSecurityIPSSignatureProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { resp.TypeName = req.ProviderTypeName + "_policy_object_security_ips_signature_profile_parcel" } -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security IPs Signature profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security IPS Signature profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -114,7 +114,7 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Schema(ctx conte } } -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -126,8 +126,8 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Configure(_ cont // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityIPsSignature +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityIPSSignature // Read plan diags := req.Plan.Get(ctx, &plan) @@ -159,8 +159,8 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Create(ctx conte // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityIPsSignature +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityIPSSignature // Read state diags := req.State.Get(ctx, &state) @@ -196,8 +196,8 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Read(ctx context // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityIPsSignature +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityIPSSignature // Read plan diags := req.Plan.Get(ctx, &plan) @@ -232,8 +232,8 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Update(ctx conte // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityIPsSignature +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityIPSSignature // Read state diags := req.State.Get(ctx, &state) @@ -258,7 +258,7 @@ func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) Delete(ctx conte // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityIPsSignatureProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityIPSSignatureProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel_test.go index b6191e920..9445cdef8 100644 --- a/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_ips_signature_profile_parcel_test.go @@ -28,7 +28,7 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityIPSSignatureProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } @@ -41,7 +41,7 @@ func TestAccSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *testing.T) { Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityIPsSignaturePrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIPsSignatureProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -51,7 +51,7 @@ func TestAccSdwanPolicyObjectSecurityIPsSignatureProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityIPsSignaturePrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityIPSSignaturePrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -62,7 +62,7 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityIPsSignatureProfileParcelConfig_all() string { +func testAccSdwanPolicyObjectSecurityIPSSignatureProfileParcelConfig_all() string { config := `resource "sdwan_policy_object_security_ips_signature_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel.go similarity index 74% rename from internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel.go index 7871cfd30..016ed17b8 100644 --- a/internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel.go @@ -22,17 +22,14 @@ import ( "context" "fmt" "net/url" - "regexp" "sync" "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" - "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-log/tflog" "github.com/netascode/go-sdwan" @@ -43,26 +40,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityFQDNProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityFQDNProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityLocalApplicationListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocalApplicationListProfileParcelResource{} -func NewPolicyObjectSecurityFQDNProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityFQDNProfileParcelResource{} +func NewPolicyObjectSecurityLocalApplicationListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityLocalApplicationListProfileParcelResource{} } -type PolicyObjectSecurityFQDNProfileParcelResource struct { +type PolicyObjectSecurityLocalApplicationListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_fqdn_profile_parcel" +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_application_list_profile_parcel" } -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security FQDN profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Local Application List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -89,17 +86,17 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Schema(ctx context.Conte Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Required: true, + MarkdownDescription: helpers.NewAttributeDescription("Localapp list").String, + Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "pattern": schema.StringAttribute{ + "app": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("").String, + Optional: true, + }, + "app_family": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("").String, Optional: true, - Validators: []validator.String{ - stringvalidator.LengthBetween(1, 120), - stringvalidator.RegexMatches(regexp.MustCompile(`^([*][.])?(([a-zA-Z0-9-]+.)+)?([a-zA-Z0-9-])+$`), ""), - }, }, }, }, @@ -108,7 +105,7 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Schema(ctx context.Conte } } -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -120,8 +117,8 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Configure(_ context.Cont // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityFQDN +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityLocalApplicationList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -153,8 +150,8 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Create(ctx context.Conte // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityFQDN +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityLocalApplicationList // Read state diags := req.State.Get(ctx, &state) @@ -190,8 +187,8 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Read(ctx context.Context // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityFQDN +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityLocalApplicationList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -226,8 +223,8 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Update(ctx context.Conte // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityFQDNProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityFQDN +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityLocalApplicationList // Read state diags := req.State.Get(ctx, &state) @@ -252,7 +249,7 @@ func (r *PolicyObjectSecurityFQDNProfileParcelResource) Delete(ctx context.Conte // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityFQDNProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityLocalApplicationListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel_test.go new file mode 100644 index 000000000..549206bc7 --- /dev/null +++ b/internal/provider/resource_sdwan_policy_object_security_local_application_list_profile_parcel_test.go @@ -0,0 +1,76 @@ +// Copyright © 2023 Cisco Systems, Inc. and its affiliates. +// All rights reserved. +// +// Licensed under the Mozilla Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://mozilla.org/MPL/2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: MPL-2.0 + +package provider + +// Section below is generated&owned by "gen/generator.go". //template:begin imports +import ( + "os" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" +) + +// End of section. //template:end imports + +// Section below is generated&owned by "gen/generator.go". //template:begin testAcc +func TestAccSdwanPolicyObjectSecurityLocalApplicationListProfileParcel(t *testing.T) { + if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { + t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") + } + var checks []resource.TestCheckFunc + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_local_application_list_profile_parcel.test", "entries.0.app", "audible-com")) + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + + { + Config: testAccSdwanPolicyObjectSecurityLocalApplicationListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityLocalApplicationListProfileParcelConfig_all(), + Check: resource.ComposeTestCheckFunc(checks...), + }, + }, + }) +} + +// End of section. //template:end testAcc + +// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites +const testAccSdwanPolicyObjectSecurityLocalApplicationListPrerequisitesProfileParcelConfig = ` +variable "policy_object_feature_template_id" {} +` + +// End of section. //template:end testPrerequisites + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum + +// End of section. //template:end testAccConfigMinimum + +// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll +func testAccSdwanPolicyObjectSecurityLocalApplicationListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_local_application_list_profile_parcel" "test" {` + "\n" + config += ` name = "TF_TEST_ALL"` + "\n" + config += ` description = "Terraform integration test"` + "\n" + config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" + config += ` entries = [{` + "\n" + config += ` app = "audible-com"` + "\n" + config += ` }]` + "\n" + config += `}` + "\n" + return config +} + +// End of section. //template:end testAccConfigAll diff --git a/internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel.go index 92dc1ab4f..e88209acb 100644 --- a/internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityLocaldomainProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocaldomainProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityLocalDomainListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocalDomainListProfileParcelResource{} -func NewPolicyObjectSecurityLocaldomainProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityLocaldomainProfileParcelResource{} +func NewPolicyObjectSecurityLocalDomainListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityLocalDomainListProfileParcelResource{} } -type PolicyObjectSecurityLocaldomainProfileParcelResource struct { +type PolicyObjectSecurityLocalDomainListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_localdomain_profile_parcel" +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_local_domain_list_profile_parcel" } -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Localdomain profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Local Domain List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -93,7 +93,7 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Schema(ctx contex Required: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "name_server": schema.StringAttribute{ + "local_domain": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("").String, Optional: true, Validators: []validator.String{ @@ -108,7 +108,7 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Schema(ctx contex } } -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -120,8 +120,8 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Configure(_ conte // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityLocaldomain +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityLocalDomainList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -153,8 +153,8 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Create(ctx contex // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityLocaldomain +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityLocalDomainList // Read state diags := req.State.Get(ctx, &state) @@ -190,8 +190,8 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Read(ctx context. // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityLocaldomain +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityLocalDomainList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -226,8 +226,8 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Update(ctx contex // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityLocaldomain +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityLocalDomainList // Read state diags := req.State.Get(ctx, &state) @@ -252,7 +252,7 @@ func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) Delete(ctx contex // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityLocaldomainProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityLocalDomainListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go similarity index 77% rename from internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go index 2dfc51574..d3f368a79 100644 --- a/internal/provider/resource_sdwan_policy_object_security_fqdn_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_local_domain_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityFQDNProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityLocalDomainListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_fqdn_profile_parcel.test", "entries.0.pattern", "cisco.com")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_local_domain_list_profile_parcel.test", "entries.0.local_domain", "hello.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityFQDNPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityFQDNProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityFQDNProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityFQDNPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityLocalDomainListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,13 +61,13 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityFQDNProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_fqdn_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityLocalDomainListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_local_domain_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` pattern = "cisco.com"` + "\n" + config += ` local_domain = "hello.com"` + "\n" config += ` }]` + "\n" config += `}` + "\n" return config diff --git a/internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel_test.go deleted file mode 100644 index 3507528ff..000000000 --- a/internal/provider/resource_sdwan_policy_object_security_localdomain_profile_parcel_test.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "os" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityLocaldomainProfileParcel(t *testing.T) { - if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { - t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") - } - var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_localdomain_profile_parcel.test", "entries.0.name_server", "hello.com")) - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - - { - Config: testAccSdwanPolicyObjectSecurityLocaldomainPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityLocaldomainProfileParcelConfig_all(), - Check: resource.ComposeTestCheckFunc(checks...), - }, - }, - }) -} - -// End of section. //template:end testAcc - -// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityLocaldomainPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} -` - -// End of section. //template:end testPrerequisites - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum - -// End of section. //template:end testAccConfigMinimum - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityLocaldomainProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_localdomain_profile_parcel" "test" {` + "\n" - config += ` name = "TF_TEST_ALL"` + "\n" - config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" - config += ` entries = [{` + "\n" - config += ` name_server = "hello.com"` + "\n" - config += ` }]` + "\n" - config += `}` + "\n" - return config -} - -// End of section. //template:end testAccConfigAll diff --git a/internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel.go similarity index 83% rename from internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel.go index 14515269f..87f8fd46a 100644 --- a/internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel.go @@ -40,26 +40,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityLocalappProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityLocalappProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityPortListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityPortListProfileParcelResource{} -func NewPolicyObjectSecurityLocalappProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityLocalappProfileParcelResource{} +func NewPolicyObjectSecurityPortListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityPortListProfileParcelResource{} } -type PolicyObjectSecurityLocalappProfileParcelResource struct { +type PolicyObjectSecurityPortListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_localapp_profile_parcel" +func (r *PolicyObjectSecurityPortListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_list_profile_parcel" } -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityPortListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Localapp profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Port List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -86,16 +86,12 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Schema(ctx context.C Required: true, }, "entries": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Localapp list").String, - Optional: true, + MarkdownDescription: helpers.NewAttributeDescription("Port List").String, + Required: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ - "app": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, - Optional: true, - }, - "app_family": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("").String, + "port": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("can be single port or port range").String, Optional: true, }, }, @@ -105,7 +101,7 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Schema(ctx context.C } } -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityPortListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -117,8 +113,8 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Configure(_ context. // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityLocalapp +func (r *PolicyObjectSecurityPortListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityPortList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -150,8 +146,8 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Create(ctx context.C // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityLocalapp +func (r *PolicyObjectSecurityPortListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityPortList // Read state diags := req.State.Get(ctx, &state) @@ -187,8 +183,8 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Read(ctx context.Con // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityLocalapp +func (r *PolicyObjectSecurityPortListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityPortList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -223,8 +219,8 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Update(ctx context.C // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityLocalappProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityLocalapp +func (r *PolicyObjectSecurityPortListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityPortList // Read state diags := req.State.Get(ctx, &state) @@ -249,7 +245,7 @@ func (r *PolicyObjectSecurityLocalappProfileParcelResource) Delete(ctx context.C // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityLocalappProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityPortListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel_test.go similarity index 82% rename from internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel_test.go index 149503a0e..e9935d3c9 100644 --- a/internal/provider/resource_sdwan_policy_object_security_localapp_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_port_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityLocalappProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityPortListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_localapp_profile_parcel.test", "entries.0.app", "audible-com")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_port_list_profile_parcel.test", "entries.0.port", "100")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityLocalappPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityLocalappProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityPortListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityLocalappProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityLocalappPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityPortListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,13 +61,13 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityLocalappProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_localapp_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityPortListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_port_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" config += ` entries = [{` + "\n" - config += ` app = "audible-com"` + "\n" + config += ` port = "100"` + "\n" config += ` }]` + "\n" config += `}` + "\n" return config diff --git a/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel.go deleted file mode 100644 index f0dc673e0..000000000 --- a/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "context" - "fmt" - "net/url" - "sync" - - "github.com/CiscoDevNet/terraform-provider-sdwan/internal/provider/helpers" - "github.com/hashicorp/terraform-plugin-framework/path" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" - "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-log/tflog" - "github.com/netascode/go-sdwan" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin model - -// Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityPortProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityPortProfileParcelResource{} - -func NewPolicyObjectSecurityPortProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityPortProfileParcelResource{} -} - -type PolicyObjectSecurityPortProfileParcelResource struct { - client *sdwan.Client - updateMutex *sync.Mutex -} - -func (r *PolicyObjectSecurityPortProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_port_profile_parcel" -} - -func (r *PolicyObjectSecurityPortProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { - resp.Schema = schema.Schema{ - // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Port profile parcel.").AddMinimumVersionDescription("20.12.0").String, - - Attributes: map[string]schema.Attribute{ - "id": schema.StringAttribute{ - MarkdownDescription: "The id of the profile parcel", - Computed: true, - PlanModifiers: []planmodifier.String{ - stringplanmodifier.UseStateForUnknown(), - }, - }, - "version": schema.Int64Attribute{ - MarkdownDescription: "The version of the profile parcel", - Computed: true, - }, - "name": schema.StringAttribute{ - MarkdownDescription: "The name of the profile parcel", - Required: true, - }, - "description": schema.StringAttribute{ - MarkdownDescription: "The description of the profile parcel", - Optional: true, - }, - "feature_profile_id": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Feature Profile ID").String, - Required: true, - }, - "entries": schema.ListNestedAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Port List").String, - Required: true, - NestedObject: schema.NestedAttributeObject{ - Attributes: map[string]schema.Attribute{ - "port": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("can be single port or port range").String, - Optional: true, - }, - }, - }, - }, - }, - } -} - -func (r *PolicyObjectSecurityPortProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { - if req.ProviderData == nil { - return - } - - r.client = req.ProviderData.(*SdwanProviderData).Client - r.updateMutex = req.ProviderData.(*SdwanProviderData).UpdateMutex -} - -// End of section. //template:end model - -// Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityPortProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityPort - - // Read plan - diags := req.Plan.Get(ctx, &plan) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Create", plan.Name.ValueString())) - - // Create object - body := plan.toBody(ctx) - - res, err := r.client.Post(plan.getPath(), body) - if err != nil { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (POST), got error: %s, %s", err, res.String())) - return - } - - plan.Id = types.StringValue(res.Get("parcelId").String()) - plan.Version = types.Int64Value(0) - - tflog.Debug(ctx, fmt.Sprintf("%s: Create finished successfully", plan.Name.ValueString())) - - diags = resp.State.Set(ctx, &plan) - resp.Diagnostics.Append(diags...) -} - -// End of section. //template:end create - -// Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityPortProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityPort - - // Read state - diags := req.State.Get(ctx, &state) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Read", state.Name.String())) - - res, err := r.client.Get(state.getPath() + "/" + url.QueryEscape(state.Id.ValueString())) - if res.Get("error.message").String() == "Invalid feature Id" { - resp.State.RemoveResource(ctx) - return - } else if err != nil { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to retrieve object (GET), got error: %s, %s", err, res.String())) - return - } - - // 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) - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Read finished successfully", state.Name.ValueString())) - - diags = resp.State.Set(ctx, &state) - resp.Diagnostics.Append(diags...) -} - -// End of section. //template:end read - -// Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityPortProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityPort - - // Read plan - diags := req.Plan.Get(ctx, &plan) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - // Read state - diags = req.State.Get(ctx, &state) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Update", plan.Name.ValueString())) - - body := plan.toBody(ctx) - res, err := r.client.Put(plan.getPath()+"/"+url.QueryEscape(plan.Id.ValueString()), body) - if err != nil { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to configure object (PUT), got error: %s, %s", err, res.String())) - return - } - - plan.Version = types.Int64Value(state.Version.ValueInt64() + 1) - - tflog.Debug(ctx, fmt.Sprintf("%s: Update finished successfully", plan.Name.ValueString())) - - diags = resp.State.Set(ctx, &plan) - resp.Diagnostics.Append(diags...) -} - -// End of section. //template:end update - -// Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityPortProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityPort - - // Read state - diags := req.State.Get(ctx, &state) - resp.Diagnostics.Append(diags...) - if resp.Diagnostics.HasError() { - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Name.ValueString())) - - res, err := r.client.Delete(state.getPath() + "/" + url.QueryEscape(state.Id.ValueString())) - if err != nil && res.Get("error.message").String() != "Invalid Template Id" { - resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (DELETE), got error: %s, %s", err, res.String())) - return - } - - tflog.Debug(ctx, fmt.Sprintf("%s: Delete finished successfully", state.Name.ValueString())) - - resp.State.RemoveResource(ctx) -} - -// End of section. //template:end delete - -// Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityPortProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) -} - -// End of section. //template:end import diff --git a/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel_test.go deleted file mode 100644 index 667f786f2..000000000 --- a/internal/provider/resource_sdwan_policy_object_security_port_profile_parcel_test.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright © 2023 Cisco Systems, Inc. and its affiliates. -// All rights reserved. -// -// Licensed under the Mozilla Public License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://mozilla.org/MPL/2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: MPL-2.0 - -package provider - -// Section below is generated&owned by "gen/generator.go". //template:begin imports -import ( - "os" - "testing" - - "github.com/hashicorp/terraform-plugin-testing/helper/resource" -) - -// End of section. //template:end imports - -// Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityPortProfileParcel(t *testing.T) { - if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { - t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") - } - var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_port_profile_parcel.test", "entries.0.port", "100")) - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, - Steps: []resource.TestStep{ - - { - Config: testAccSdwanPolicyObjectSecurityPortPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityPortProfileParcelConfig_all(), - Check: resource.ComposeTestCheckFunc(checks...), - }, - }, - }) -} - -// End of section. //template:end testAcc - -// Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityPortPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} -` - -// End of section. //template:end testPrerequisites - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimum - -// End of section. //template:end testAccConfigMinimum - -// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityPortProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_port_profile_parcel" "test" {` + "\n" - config += ` name = "TF_TEST_ALL"` + "\n" - config += ` description = "Terraform integration test"` + "\n" - config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" - config += ` entries = [{` + "\n" - config += ` port = "100"` + "\n" - config += ` }]` + "\n" - config += `}` + "\n" - return config -} - -// End of section. //template:end testAccConfigAll diff --git a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go index 6883c9e03..ad1eae854 100644 --- a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.go @@ -42,26 +42,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityScalableGroupTagProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityScalableGroupTagProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{} -func NewPolicyObjectSecurityScalableGroupTagProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityScalableGroupTagProfileParcelResource{} +func NewPolicyObjectSecurityScalableGroupTagListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityScalableGroupTagListProfileParcelResource{} } -type PolicyObjectSecurityScalableGroupTagProfileParcelResource struct { +type PolicyObjectSecurityScalableGroupTagListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_profile_parcel" +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_scalable_group_tag_list_profile_parcel" } -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Scalable Group Tag profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security Scalable Group Tag List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -113,7 +113,7 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Schema(ctx c } } -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -125,8 +125,8 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Configure(_ // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityScalableGroupTag +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityScalableGroupTagList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -158,8 +158,8 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Create(ctx c // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityScalableGroupTag +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityScalableGroupTagList // Read state diags := req.State.Get(ctx, &state) @@ -195,8 +195,8 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Read(ctx con // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityScalableGroupTag +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityScalableGroupTagList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -231,8 +231,8 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Update(ctx c // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityScalableGroupTag +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityScalableGroupTagList // Read state diags := req.State.Get(ctx, &state) @@ -257,7 +257,7 @@ func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) Delete(ctx c // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityScalableGroupTagProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityScalableGroupTagListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go index 90b8d9169..637b22360 100644 --- a/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_scalable_group_tag_list_profile_parcel_test.go @@ -28,20 +28,20 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityScalableGroupTagProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_profile_parcel.test", "entries.0.sgt_name", "ANY")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_profile_parcel.test", "entries.0.tag", "65535")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.test", "entries.0.sgt_name", "ANY")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_scalable_group_tag_list_profile_parcel.test", "entries.0.tag", "65535")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityScalableGroupTagPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityScalableGroupTagProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -51,7 +51,7 @@ func TestAccSdwanPolicyObjectSecurityScalableGroupTagProfileParcel(t *testing.T) // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityScalableGroupTagPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityScalableGroupTagListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -62,8 +62,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityScalableGroupTagProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_scalable_group_tag_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityScalableGroupTagListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_scalable_group_tag_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel.go similarity index 88% rename from internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel.go index 28ba06ac0..621e2cf81 100644 --- a/internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel.go @@ -43,26 +43,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectSecurityURLlistProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectSecurityURLlistProfileParcelResource{} +var _ resource.Resource = &PolicyObjectSecurityURLListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectSecurityURLListProfileParcelResource{} -func NewPolicyObjectSecurityURLlistProfileParcelResource() resource.Resource { - return &PolicyObjectSecurityURLlistProfileParcelResource{} +func NewPolicyObjectSecurityURLListProfileParcelResource() resource.Resource { + return &PolicyObjectSecurityURLListProfileParcelResource{} } -type PolicyObjectSecurityURLlistProfileParcelResource struct { +type PolicyObjectSecurityURLListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_security_urllist_profile_parcel" +func (r *PolicyObjectSecurityURLListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_security_url_list_profile_parcel" } -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectSecurityURLListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security URLlist profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Security URL List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -108,7 +108,7 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Schema(ctx context.Co } } -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectSecurityURLListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -120,8 +120,8 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Configure(_ context.C // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectSecurityURLlist +func (r *PolicyObjectSecurityURLListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectSecurityURLList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -153,8 +153,8 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Create(ctx context.Co // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectSecurityURLlist +func (r *PolicyObjectSecurityURLListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectSecurityURLList // Read state diags := req.State.Get(ctx, &state) @@ -190,8 +190,8 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Read(ctx context.Cont // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectSecurityURLlist +func (r *PolicyObjectSecurityURLListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectSecurityURLList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -226,8 +226,8 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Update(ctx context.Co // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectSecurityURLlistProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectSecurityURLlist +func (r *PolicyObjectSecurityURLListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectSecurityURLList // Read state diags := req.State.Get(ctx, &state) @@ -252,7 +252,7 @@ func (r *PolicyObjectSecurityURLlistProfileParcelResource) Delete(ctx context.Co // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectSecurityURLlistProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectSecurityURLListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel_test.go similarity index 83% rename from internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel_test.go index c003ba437..69292e468 100644 --- a/internal/provider/resource_sdwan_policy_object_security_urllist_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_security_url_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectSecurityURLlistProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectSecurityURLListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_urllist_profile_parcel.test", "entries.0.pattern", "www.cisco.com")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_security_url_list_profile_parcel.test", "entries.0.pattern", "www.cisco.com")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectSecurityURLlistPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityURLlistProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectSecurityURLListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectSecurityURLlistProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectSecurityURLlistPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectSecurityURLListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,8 +61,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectSecurityURLlistProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_security_urllist_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectSecurityURLListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_security_url_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel.go b/internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel.go rename to internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel.go index 5a2cf9d11..43fb596a1 100644 --- a/internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel.go +++ b/internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel.go @@ -40,26 +40,26 @@ import ( // Section below is generated&owned by "gen/generator.go". //template:begin model // Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &PolicyObjectStandardCommunityProfileParcelResource{} -var _ resource.ResourceWithImportState = &PolicyObjectStandardCommunityProfileParcelResource{} +var _ resource.Resource = &PolicyObjectStandardCommunityListProfileParcelResource{} +var _ resource.ResourceWithImportState = &PolicyObjectStandardCommunityListProfileParcelResource{} -func NewPolicyObjectStandardCommunityProfileParcelResource() resource.Resource { - return &PolicyObjectStandardCommunityProfileParcelResource{} +func NewPolicyObjectStandardCommunityListProfileParcelResource() resource.Resource { + return &PolicyObjectStandardCommunityListProfileParcelResource{} } -type PolicyObjectStandardCommunityProfileParcelResource struct { +type PolicyObjectStandardCommunityListProfileParcelResource struct { client *sdwan.Client updateMutex *sync.Mutex } -func (r *PolicyObjectStandardCommunityProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { - resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_profile_parcel" +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = req.ProviderTypeName + "_policy_object_standard_community_list_profile_parcel" } -func (r *PolicyObjectStandardCommunityProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ // This description is used by the documentation generator and the language server. - MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Standard Community profile parcel.").AddMinimumVersionDescription("20.12.0").String, + MarkdownDescription: helpers.NewAttributeDescription("This resource can manage a Policy Object Standard Community List profile parcel.").AddMinimumVersionDescription("20.12.0").String, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -101,7 +101,7 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Schema(ctx context. } } -func (r *PolicyObjectStandardCommunityProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Configure(_ context.Context, req resource.ConfigureRequest, _ *resource.ConfigureResponse) { if req.ProviderData == nil { return } @@ -113,8 +113,8 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Configure(_ context // End of section. //template:end model // Section below is generated&owned by "gen/generator.go". //template:begin create -func (r *PolicyObjectStandardCommunityProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { - var plan PolicyObjectStandardCommunity +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan PolicyObjectStandardCommunityList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -146,8 +146,8 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Create(ctx context. // End of section. //template:end create // Section below is generated&owned by "gen/generator.go". //template:begin read -func (r *PolicyObjectStandardCommunityProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { - var state PolicyObjectStandardCommunity +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state PolicyObjectStandardCommunityList // Read state diags := req.State.Get(ctx, &state) @@ -183,8 +183,8 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Read(ctx context.Co // End of section. //template:end read // Section below is generated&owned by "gen/generator.go". //template:begin update -func (r *PolicyObjectStandardCommunityProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { - var plan, state PolicyObjectStandardCommunity +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state PolicyObjectStandardCommunityList // Read plan diags := req.Plan.Get(ctx, &plan) @@ -219,8 +219,8 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Update(ctx context. // End of section. //template:end update // Section below is generated&owned by "gen/generator.go". //template:begin delete -func (r *PolicyObjectStandardCommunityProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { - var state PolicyObjectStandardCommunity +func (r *PolicyObjectStandardCommunityListProfileParcelResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state PolicyObjectStandardCommunityList // Read state diags := req.State.Get(ctx, &state) @@ -245,7 +245,7 @@ func (r *PolicyObjectStandardCommunityProfileParcelResource) Delete(ctx context. // End of section. //template:end delete // Section below is generated&owned by "gen/generator.go". //template:begin import -func (r *PolicyObjectStandardCommunityProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { +func (r *PolicyObjectStandardCommunityListProfileParcelResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) } diff --git a/internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel_test.go b/internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel_test.go similarity index 79% rename from internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel_test.go rename to internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel_test.go index d1223c0e6..089d6a22e 100644 --- a/internal/provider/resource_sdwan_policy_object_standard_community_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_policy_object_standard_community_list_profile_parcel_test.go @@ -28,19 +28,19 @@ import ( // End of section. //template:end imports // Section below is generated&owned by "gen/generator.go". //template:begin testAcc -func TestAccSdwanPolicyObjectStandardCommunityProfileParcel(t *testing.T) { +func TestAccSdwanPolicyObjectStandardCommunityListProfileParcel(t *testing.T) { if os.Getenv("SDWAN_2012") == "" && os.Getenv("TF_VAR_policy_object_feature_template_id") == "" { t.Skip("skipping test, set environment variable SDWAN_2012 or TF_VAR_policy_object_feature_template_id") } var checks []resource.TestCheckFunc - checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_standard_community_profile_parcel.test", "entries.0.standard_community", "1000:10000")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_policy_object_standard_community_list_profile_parcel.test", "entries.0.standard_community", "1000:10000")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV6ProviderFactories: testAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSdwanPolicyObjectStandardCommunityPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectStandardCommunityProfileParcelConfig_all(), + Config: testAccSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig + testAccSdwanPolicyObjectStandardCommunityListProfileParcelConfig_all(), Check: resource.ComposeTestCheckFunc(checks...), }, }, @@ -50,7 +50,7 @@ func TestAccSdwanPolicyObjectStandardCommunityProfileParcel(t *testing.T) { // End of section. //template:end testAcc // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites -const testAccSdwanPolicyObjectStandardCommunityPrerequisitesProfileParcelConfig = ` +const testAccSdwanPolicyObjectStandardCommunityListPrerequisitesProfileParcelConfig = ` variable "policy_object_feature_template_id" {} ` @@ -61,8 +61,8 @@ variable "policy_object_feature_template_id" {} // End of section. //template:end testAccConfigMinimum // Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll -func testAccSdwanPolicyObjectStandardCommunityProfileParcelConfig_all() string { - config := `resource "sdwan_policy_object_standard_community_profile_parcel" "test" {` + "\n" +func testAccSdwanPolicyObjectStandardCommunityListProfileParcelConfig_all() string { + config := `resource "sdwan_policy_object_standard_community_list_profile_parcel" "test" {` + "\n" config += ` name = "TF_TEST_ALL"` + "\n" config += ` description = "Terraform integration test"` + "\n" config += ` feature_profile_id = var.policy_object_feature_template_id` + "\n" diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index 777fe4e1c..63cbe487e 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -47,21 +47,21 @@ description: |- - Add `sdwan_service_switchport_profile_parcel` resource and data source - Add `sdwan_transport_route_policy_profile_parcel` resource and data source - Add `sdwan_service_route_policy_profile_parcel` resource and data source -- Add `sdwan_policy_object_app_probe_profile_parcel` resource and data source -- Add `sdwan_policy_object_as_path_profile_parcel` resource and data source +- Add `sdwan_policy_object_app_probe_class_profile_parcel` resource and data source +- Add `sdwan_policy_object_as_path_list_profile_parcel` resource and data source - Add `sdwan_policy_object_vpn_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_data_ip_prefix_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_fqdn_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_geolocation_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_data_ipv4_prefix_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_fqdn_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_geolocation_list_profile_parcel` resource and data source - Add `sdwan_policy_object_security_ips_signature_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localdomain_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_port_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_scalable_group_tag_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_urllist_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_domain_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_port_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_scalable_group_tag_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_url_list_profile_parcel` resource and data source - Add `sdwan_policy_object_preferred_color_group_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_identity_profile_parcel` resource and data source -- Add `sdwan_policy_object_security_localapp_profile_parcel` resource and data source -- Add `sdwan_policy_object_standard_community_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_identity_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_security_local_application_list_profile_parcel` resource and data source +- Add `sdwan_policy_object_standard_community_list_profile_parcel` resource and data source ## 0.3.13